Skip to content

Commit 37ca389

Browse files
committed
test for using some libs without depending on them
1 parent 4e967ba commit 37ca389

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/meridian/metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"name": "Meridian Clock",
44
"shortName": "Meridian",
55
"version": "0.01",
6-
"description": "An elegant clock",
6+
"description": "An elegant clock with two ClockInfos",
77
"screenshots": [{ "url": "screenshot.png" }],
88
"icon": "icon.png",
99
"type": "clock",
10-
"tags": "clock",
10+
"tags": "clock,clkinfo",
1111
"supports": ["BANGLEJS2"],
12+
"dependencies" : { "clock_info":"module" },
1213
"readme": "README.md",
1314
"storage": [
1415
{ "name": "meridian.app.js", "url": "app.js" },

bin/sanitycheck.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ apps.forEach((app,appIdx) => {
343343
if (a>=0 && b>=0 && a<b)
344344
WARN(`Clock ${app.id} file calls loadWidgets before setUI (clock widget/etc won't be aware a clock app is running)`, {file:appDirRelative+file.url, line : fileContents.substr(0,a).split("\n").length});
345345
}
346+
if (fileContents.includes("clock_info") && (!app.dependencies || !app.dependencies.clock_info) && !["boot","clock_info"].includes(app.id))
347+
ERROR(`App ${app.id}'s uses clock_info but doesn't have a dependency on it`, {file:appDirRelative+file.url});
348+
if (fileContents.includes("clockbg") && (!app.dependencies || !app.dependencies.clockbg) && !["clockbg"].includes(app.id))
349+
ERROR(`App ${app.id}'s uses clockbg but doesn't have a dependency on it`, {file:appDirRelative+file.url});
346350
// if settings
347351
if (/\.settings?\.js$/.test(file.name)) {
348352
// suggest adding to datafiles

0 commit comments

Comments
 (0)