From fa88a3edc00776aa0f418bca2ac6d3cd17f4c2a5 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 18 Jan 2024 18:43:14 +0000 Subject: [PATCH] sanitycheck: improve boolean formatter regex check for "on", and make case-insensitive --- bin/sanitycheck.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js index 945bb8bff..4e6662e4a 100755 --- a/bin/sanitycheck.js +++ b/bin/sanitycheck.js @@ -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}); } // check for manual boolean formatter - const m = fileContents.match(/format: *\(\) *=>.*["']Yes["']/); + const m = fileContents.match(/format: *\(\) *=>.*["'](yes|on)["']/i); 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}); }