Skip to content

Commit 2eb84e3

Browse files
authored
Merge pull request #4309 from RKBoss6/patch-4
[SanityCheck] Check for widget ids starting with 'wid'
2 parents 05252e2 + 968dad3 commit 2eb84e3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

bin/sanitycheck.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ const INTERNAL_FILES_IN_APP_TYPE = { // list of app types and files they SHOULD
183183
'textinput' : ['textinput'],
184184
// notify?
185185
};
186+
const ID_NAMING_EXCEPTIONS = ["1button", "airqualityci", "banglebridge", "chimer", "f3bluemoon", "gbridge", "gpsautotime", "gpstimeserver", "grandfatherclock", "hralarm", "hwid_a_battery_widget", "lightswitch", "openseizure", "rndmclk", "sleeplogalarm", "worldclkinfo"];
186187

187188
function globToRegex(pattern) {
188189
const ESCAPE = '.*+-?^${}()|[]\\';
@@ -250,6 +251,8 @@ apps.forEach((app,appIdx) => {
250251
}
251252
if (!app.description) ERROR(`App ${app.id} has no description`, {file:metadataFile});
252253
if (!app.icon) ERROR(`App ${app.id} has no icon`, {file:metadataFile});
254+
if (app.type == "widget" && !app.id.startsWith("wid") && !ID_NAMING_EXCEPTIONS.includes(app.id)) ERROR(`Widget app ${app.id} id does not start with 'wid'`, {file:metadataFile});
255+
if (app.type == "clkinfo" && !app.id.startsWith("clkinfo") && !ID_NAMING_EXCEPTIONS.includes(app.id)) ERROR(`ClockInfo app ${app.id} id does not start with 'clkinfo'`, {file:metadataFile});
253256
if (!fs.existsSync(appDir+app.icon)) ERROR(`App ${app.id} icon doesn't exist`, {file:metadataFile});
254257
if (app.screenshots) {
255258
if (!Array.isArray(app.screenshots)) ERROR(`App ${app.id} screenshots is not an array`, {file:metadataFile});

0 commit comments

Comments
 (0)