sanitycheck: improve boolean formatter regex
check for "on", and make case-insensitivemaster
parent
b5b65406c0
commit
fa88a3edc0
|
|
@ -263,7 +263,7 @@ apps.forEach((app,appIdx) => {
|
||||||
WARN(`App ${app.id} has a setting file but no corresponding data entry (add \`"data":[{"name":"${app.id}.settings.json"}]\`)`, {file:appDirRelative+file.url});
|
WARN(`App ${app.id} has a setting file but no corresponding data entry (add \`"data":[{"name":"${app.id}.settings.json"}]\`)`, {file:appDirRelative+file.url});
|
||||||
}
|
}
|
||||||
// check for manual boolean formatter
|
// check for manual boolean formatter
|
||||||
const m = fileContents.match(/format: *\(\) *=>.*["']Yes["']/);
|
const m = fileContents.match(/format: *\(\) *=>.*["'](yes|on)["']/i);
|
||||||
if (m) {
|
if (m) {
|
||||||
WARN(`Settings for ${app.id} has a boolean formatter - this is handled automatically, the line can be removed`, {file:appDirRelative+file.url, line: fileContents.substr(0, m.index).split("\n").length});
|
WARN(`Settings for ${app.id} has a boolean formatter - this is handled automatically, the line can be removed`, {file:appDirRelative+file.url, line: fileContents.substr(0, m.index).split("\n").length});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue