@iobroker/repochecker 5.7.1 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/lib/M1000_IOPackageJson.js +20 -1
- package/lib/M4000_Repository.js +1 -1
- package/lib/M5000_Code.js +37 -0
- package/lib/M5500__JsonConfig.js +6 -1
- package/lib/M6000_Readme.js +52 -0
- package/lib/M8900__Dependabot.js +35 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,12 +25,22 @@ Example:
|
|
|
25
25
|
Placeholder for the next version (at the beginning of the line):
|
|
26
26
|
### **WORK IN PROGRESS**
|
|
27
27
|
-->
|
|
28
|
+
### 5.9.0 (2026-04-08)
|
|
29
|
+
- (@copilot) Added checks W1114/S1114: warn when `common.schedule` is set to a non-empty value for daemon adapters (not supported), and suggest removal when `common.schedule` is an empty string for daemon adapters (unused). Related to [#806].
|
|
30
|
+
- (@copilot) Added checks to help maintain organized changelog files: warns when CHANGELOG.md is present (changelog belongs in README.md), when both CHANGELOG.md and CHANGELOG_OLD.md coexist, when the README changelog exceeds 20 entries without a CHANGELOG_OLD.md, and suggests adding CHANGELOG_OLD.md when no such file exists. [W6017, W6018, W6019, S6020]
|
|
31
|
+
|
|
32
|
+
### 5.8.0 (2026-04-07)
|
|
33
|
+
- (@copilot) Limit the listing of `allowedValues` in schema validation errors (E1105, W5512) to 5 values, appending `...` when there are more possibilities.
|
|
34
|
+
- (@copilot) [W5046] Added warning when `admin/jsonConfig.json` or `admin/jsonConfig.json5` is present but `common.adminUI.config` is not set to `"json"` in `io-package.json`.
|
|
35
|
+
- (@copilot) [W5047] Added warning listing obsolete files (`admin/index.html`, `admin/index_m.html`, `admin/style.css`) when jsonConfig is used.
|
|
36
|
+
|
|
28
37
|
### 5.7.1 (2026-04-07)
|
|
29
38
|
- (mcm1957) Improve jsonConfig schema validation messages.
|
|
30
39
|
|
|
31
40
|
### 5.7.0 (2026-04-06)
|
|
32
41
|
- (@copilot) [S8913] automerge suggestion is no longer shown when dependabot is not configured ([S8901]).
|
|
33
42
|
- (@copilot) Language detection: `GERMAN_WORDS` and `ENGLISH_WORDS` arrays sorted alphabetically; chapters titled "Haftungsausschluss" in README.md are now ignored when checking for German text.
|
|
43
|
+
- (@copilot) Added [W8915]: warn when a dependabot npm entry has no cooldown or a cooldown of less than 5 days configured, recommending at least 7 days to reduce supply chain risk.
|
|
34
44
|
- (@copilot) Added JSON5 support for `jsonTab.json5`: `admin/jsonTab.json` and `admin/jsonTab.json5` are now read and parsed; E5044 is raised for parse errors and E5045 when the file is missing but tab support is declared. [#780]
|
|
35
45
|
- (@copilot) Fixed false-positive W4042/W4044 warnings for adapters using only `jsonConfig.json5`: the VS Code schema checks now detect which config files actually exist in the repository and use `some()` instead of `every()` to match schema entries, preventing false warnings when a valid json5-only schema is configured. [#780]
|
|
36
46
|
- (@copilot) Added schema validation for all present jsonConfig files (`admin/jsonConfig.json`, `admin/jsonCustom.json`, `admin/jsonTab.json` and their `.json5` variants) against the official jsonConfig JSON schema; errors reported as E5512, schema download failures as W5513, and exceptions as E5514. [#803]
|
|
@@ -146,7 +146,12 @@ async function validateIOPackageSchema(context) {
|
|
|
146
146
|
} else if (error.keyword === 'type') {
|
|
147
147
|
errorMsg = `Property "${path}" should be ${error.params.type}`;
|
|
148
148
|
} else if (error.keyword === 'enum') {
|
|
149
|
-
|
|
149
|
+
const allowedValues = error.params.allowedValues ?? [];
|
|
150
|
+
const displayValues =
|
|
151
|
+
allowedValues.length > 5
|
|
152
|
+
? `${allowedValues.slice(0, 5).join(', ')}, ...`
|
|
153
|
+
: allowedValues.join(', ');
|
|
154
|
+
errorMsg = `Property "${path}" should be one of: ${displayValues}`;
|
|
150
155
|
} else {
|
|
151
156
|
errorMsg = `Property "${path}" ${message}`;
|
|
152
157
|
}
|
|
@@ -648,6 +653,19 @@ async function checkIOPackageJson(context) {
|
|
|
648
653
|
);
|
|
649
654
|
}
|
|
650
655
|
|
|
656
|
+
// Check schedule attribute - not supported for daemon adapters
|
|
657
|
+
if (context.ioPackageJson.common.mode === 'daemon' && context.ioPackageJson.common.schedule !== undefined) {
|
|
658
|
+
if (context.ioPackageJson.common.schedule === '') {
|
|
659
|
+
context.warnings.push(
|
|
660
|
+
'[S1114] "common.schedule" is unused for daemon adapters. Please remove the attribute from io-package.json.',
|
|
661
|
+
);
|
|
662
|
+
} else {
|
|
663
|
+
context.warnings.push(
|
|
664
|
+
'[W1114] "common.schedule" is not supported for daemon adapters and should be removed from io-package.json.',
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
651
669
|
if (
|
|
652
670
|
context.ioPackageJson.common.mode === 'extension' &&
|
|
653
671
|
!context.ioPackageJson.common.dependencies.find(dep => Object.keys(dep).find(attr => attr === 'web'))
|
|
@@ -1379,3 +1397,4 @@ exports.checkIOPackageJson = checkIOPackageJson;
|
|
|
1379
1397
|
// [1111] -- moved to M5000_Code.js as [E5040] (check deferred to allow scanning admin UI files)
|
|
1380
1398
|
// [1112] "notifications" in io-package.json must be translated into all supported languages
|
|
1381
1399
|
// [1113] "native" config object will not be used when "common.adminUI.config" is set to "none". Please remove native properties from io-package.json.
|
|
1400
|
+
// [1114] "common.schedule" is not supported / unused for daemon adapters and should be removed from io-package.json.
|
package/lib/M4000_Repository.js
CHANGED
|
@@ -38,7 +38,7 @@ async function checkRepository(context) {
|
|
|
38
38
|
} else {
|
|
39
39
|
context.latestRepo = body;
|
|
40
40
|
if (!context.latestRepo[context.adapterName]) {
|
|
41
|
-
context.warnings.push(`[W4001] Cannot find "${context.adapterName}" in latest repository
|
|
41
|
+
context.warnings.push(`[W4001] Cannot find "${context.adapterName}" in latest repository. Please ignore if PR to add adapter to repositories already exists.`);
|
|
42
42
|
|
|
43
43
|
if (context.adapterName.includes('_')) {
|
|
44
44
|
context.errors.push('[E4021] Adapter name should use "-" instead of "_"');
|
package/lib/M5000_Code.js
CHANGED
|
@@ -735,6 +735,41 @@ async function checkCode(context) {
|
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
737
|
|
|
738
|
+
// Check if admin/jsonConfig.json or admin/jsonConfig.json5 exists but common.adminUI.config is not set to "json" (W5046)
|
|
739
|
+
if (
|
|
740
|
+
(context.filesList.includes('/admin/jsonConfig.json') ||
|
|
741
|
+
context.filesList.includes('/admin/jsonConfig.json5')) &&
|
|
742
|
+
(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')
|
|
743
|
+
) {
|
|
744
|
+
context.errors.push(
|
|
745
|
+
'[E5046] Using admin/jsonConfig.json(5) requires common.adminUI to be set to "common.adminUI": { "config": "json" }.',
|
|
746
|
+
);
|
|
747
|
+
} else if (
|
|
748
|
+
(context.filesList.includes('/admin/jsonConfig.json') ||
|
|
749
|
+
context.filesList.includes('/admin/jsonConfig.json5')) &&
|
|
750
|
+
!(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json')
|
|
751
|
+
) {
|
|
752
|
+
context.warnings.push(
|
|
753
|
+
'[W5046] Using admin/jsonConfig.json(5) requires common.adminUI to be set to "common.adminUI": { "config": "json" }.',
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// Check for obsolete admin files (index.html, index_m.html, style.css) when jsonConfig is used (W5047)
|
|
758
|
+
if (
|
|
759
|
+
context.ioPackageJson.common.adminUI &&
|
|
760
|
+
context.ioPackageJson.common.adminUI.config === 'json' &&
|
|
761
|
+
(context.filesList.includes('/admin/jsonConfig.json') || context.filesList.includes('/admin/jsonConfig.json5'))
|
|
762
|
+
) {
|
|
763
|
+
const obsoleteFiles = ['/admin/index.html', '/admin/index_m.html', '/admin/style.css'];
|
|
764
|
+
for (const file of obsoleteFiles) {
|
|
765
|
+
if (context.filesList.includes(file)) {
|
|
766
|
+
context.warnings.push(
|
|
767
|
+
`[W5047] "${file.replace(/^\//, '')}" is most likely outdated since jsonConfig is used. Please consider removing it.`,
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
738
773
|
if (
|
|
739
774
|
context.ioPackageJson.common.supportCustoms ||
|
|
740
775
|
context.ioPackageJson.common.jsonCustom ||
|
|
@@ -1413,6 +1448,8 @@ exports.checkCode = checkCode;
|
|
|
1413
1448
|
// [S5043] Package "${packageName}" is a built-in Node.js module. Please use "node:${packageName}" prefix instead.
|
|
1414
1449
|
// [E5044] Cannot parse "/admin/jsonTab.json[5]": ${e}
|
|
1415
1450
|
// [E5045] "/admin/jsonTab.json[5]" not found, but tab support is declared
|
|
1451
|
+
// [W5046] "admin/jsonConfig.json" or "admin/jsonConfig.json5" found but "common.adminUI.config" is not set to "json" in io-package.json. Please add "common.adminUI": { "config": "json" }.
|
|
1452
|
+
// [W5047] "${file}" is most likely outdated since jsonConfig is used. Please consider removing it.
|
|
1416
1453
|
// [W5515] Schema validation skipped for "${configFile}" due to parse error: ${e.message}
|
|
1417
1454
|
|
|
1418
1455
|
// [5500 - ] see M5500_jsonConfig.js
|
package/lib/M5500__JsonConfig.js
CHANGED
|
@@ -715,7 +715,12 @@ async function validateJsonConfigSchema(context, filePath, jsonConfigData) {
|
|
|
715
715
|
} else if (error.keyword === 'type') {
|
|
716
716
|
errorMsg = `Property "${path}" should be ${error.params.type}`;
|
|
717
717
|
} else if (error.keyword === 'enum') {
|
|
718
|
-
|
|
718
|
+
const allowedValues = error.params.allowedValues ?? [];
|
|
719
|
+
const displayValues =
|
|
720
|
+
allowedValues.length > 5
|
|
721
|
+
? `${allowedValues.slice(0, 5).join(', ')}, ...`
|
|
722
|
+
: allowedValues.join(', ');
|
|
723
|
+
errorMsg = `Property "${path}" should be one of: ${displayValues}`;
|
|
719
724
|
} else {
|
|
720
725
|
errorMsg = `Property "${path}" ${message}`;
|
|
721
726
|
}
|
package/lib/M6000_Readme.js
CHANGED
|
@@ -266,10 +266,21 @@ function getMaxYearFromText(text) {
|
|
|
266
266
|
return allYears.length > 0 ? Math.max(...allYears) : 0;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
// Adapters that are allowed to have a CHANGELOG.md instead of keeping the changelog in README.md
|
|
270
|
+
const CHANGELOG_MD_ALLOW_LIST = ['js-controller', 'admin'];
|
|
271
|
+
|
|
272
|
+
// Maximum number of changelog entries in README before a warning is issued about CHANGELOG_OLD.md
|
|
273
|
+
const MAX_README_CHANGELOG_ENTRIES = 20;
|
|
274
|
+
|
|
269
275
|
async function checkReadme(context) {
|
|
270
276
|
// https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/README.md
|
|
271
277
|
console.log('\n[E6000 - E6999] checkReadme');
|
|
272
278
|
|
|
279
|
+
// Get the list of files to check for CHANGELOG.md and CHANGELOG_OLD.md
|
|
280
|
+
const filesList = await common.getFilesList(context);
|
|
281
|
+
const hasChangelogMd = filesList.some(f => f.toLowerCase() === '/changelog.md');
|
|
282
|
+
const hasChangelogOldMd = filesList.some(f => f.toLowerCase() === '/changelog_old.md');
|
|
283
|
+
|
|
273
284
|
const data = await common.getFile(context, '/README.md');
|
|
274
285
|
if (!data) {
|
|
275
286
|
context.errors.push('[E6001] No README.md found');
|
|
@@ -294,6 +305,29 @@ async function checkReadme(context) {
|
|
|
294
305
|
} else {
|
|
295
306
|
context.checks.push('README.md contains current adapter version');
|
|
296
307
|
}
|
|
308
|
+
|
|
309
|
+
// Count the number of version entries (### headers) in the Changelog section
|
|
310
|
+
const changelogStart = data.indexOf('## Changelog');
|
|
311
|
+
const afterChangelog = data.substring(changelogStart + '## Changelog'.length);
|
|
312
|
+
const nextSectionMatch = afterChangelog.match(/\n## /);
|
|
313
|
+
const changelogSection = nextSectionMatch
|
|
314
|
+
? afterChangelog.substring(0, nextSectionMatch.index)
|
|
315
|
+
: afterChangelog;
|
|
316
|
+
const versionEntryCount = (changelogSection.match(/^###\s+/gm) || []).length;
|
|
317
|
+
|
|
318
|
+
if (!hasChangelogOldMd) {
|
|
319
|
+
if (versionEntryCount > MAX_README_CHANGELOG_ENTRIES) {
|
|
320
|
+
context.warnings.push(
|
|
321
|
+
`[W6019] README.md contains ${versionEntryCount} changelog entries. Consider adding CHANGELOG_OLD.md file supported by @alcalzone/releasescript.`,
|
|
322
|
+
);
|
|
323
|
+
} else {
|
|
324
|
+
context.warnings.push(
|
|
325
|
+
'[S6020] Consider adding a CHANGELOG_OLD.md file to store older changelog entries. This is supported by @alcalzone/releasescript.',
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
context.checks.push('CHANGELOG_OLD.md found');
|
|
330
|
+
}
|
|
297
331
|
}
|
|
298
332
|
|
|
299
333
|
let npmYear = 0;
|
|
@@ -453,6 +487,20 @@ async function checkReadme(context) {
|
|
|
453
487
|
}
|
|
454
488
|
}
|
|
455
489
|
|
|
490
|
+
// Check for CHANGELOG.md — changelog should be in README.md (some adapters are exempt)
|
|
491
|
+
if (hasChangelogMd) {
|
|
492
|
+
if (!CHANGELOG_MD_ALLOW_LIST.includes(context.adapterName)) {
|
|
493
|
+
context.warnings.push(
|
|
494
|
+
'[W6017] CHANGELOG.md detected. The changelog must be located within README.md.',
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
if (hasChangelogOldMd) {
|
|
498
|
+
context.warnings.push(
|
|
499
|
+
'[W6018] Both CHANGELOG.md and CHANGELOG_OLD.md files were found. This need to be cleaned up.',
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
456
504
|
return context;
|
|
457
505
|
}
|
|
458
506
|
|
|
@@ -477,3 +525,7 @@ exports.checkReadme = checkReadme;
|
|
|
477
525
|
// [S6014] README.md contains an "## Installation" section. Adapter installation is covered by standard ioBroker procedures. This section should be removed unless the adapter requires special installation handling.
|
|
478
526
|
// [E6015] README.md appears to be written in German (detected word: "..."). README.md must be written in English.
|
|
479
527
|
// [W6016] README.md does not appear to be written in English. README.md must be written in English.
|
|
528
|
+
// [W6017] A CHANGELOG.md file was found. The changelog should be located within README.md instead.
|
|
529
|
+
// [W6018] Both CHANGELOG.md and CHANGELOG_OLD.md files were found. Please check why both files exist.
|
|
530
|
+
// [W6019] README.md changelog contains ${versionEntryCount} entries. Please consider moving older entries to a separate CHANGELOG_OLD.md file, which is supported by @alcalzone/releasescript.
|
|
531
|
+
// [S6020] Consider adding a CHANGELOG_OLD.md file to store older changelog entries. This file is supported by @alcalzone/releasescript.
|
package/lib/M8900__Dependabot.js
CHANGED
|
@@ -221,6 +221,40 @@ async function checkDependabot(context) {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
// W8915: Check npm entries for cooldown configuration to reduce supply chain risk
|
|
225
|
+
if (hasNpm) {
|
|
226
|
+
const npmEntries = updates.filter(u => u['package-ecosystem'] === 'npm');
|
|
227
|
+
for (const npmEntry of npmEntries) {
|
|
228
|
+
const cooldownConfig = npmEntry['cooldown'];
|
|
229
|
+
const entryDir = npmEntry['directory'] || '/';
|
|
230
|
+
|
|
231
|
+
if (cooldownConfig == null) {
|
|
232
|
+
context.warnings.push(
|
|
233
|
+
`[W8915] Dependabot npm entry (directory: "${entryDir}") has no "cooldown" configured. ` +
|
|
234
|
+
`A cooldown of at least 7 days (e.g. "cooldown: { default: 7 }") is recommended to reduce supply chain risk.`,
|
|
235
|
+
);
|
|
236
|
+
} else {
|
|
237
|
+
let effectiveCooldown = null;
|
|
238
|
+
if (typeof cooldownConfig === 'number') {
|
|
239
|
+
effectiveCooldown = cooldownConfig;
|
|
240
|
+
} else if (typeof cooldownConfig === 'object' && typeof cooldownConfig['default'] === 'number') {
|
|
241
|
+
effectiveCooldown = cooldownConfig['default'];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (effectiveCooldown !== null && effectiveCooldown < 5) {
|
|
245
|
+
context.warnings.push(
|
|
246
|
+
`[W8915] Dependabot npm entry (directory: "${entryDir}") has a cooldown of ${effectiveCooldown} days which is less than 5 days. ` +
|
|
247
|
+
`A cooldown of at least 7 days is recommended to reduce supply chain risk.`,
|
|
248
|
+
);
|
|
249
|
+
} else if (effectiveCooldown !== null) {
|
|
250
|
+
context.checks.push(
|
|
251
|
+
`Dependabot npm entry (directory: "${entryDir}") has a cooldown of ${effectiveCooldown} days configured.`,
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
224
258
|
// Check each update entry for schedule and open-pull-requests-limit issues
|
|
225
259
|
const monthlyEcosystems = [];
|
|
226
260
|
for (const update of updates) {
|
|
@@ -306,3 +340,4 @@ exports.checkDependabot = checkDependabot;
|
|
|
306
340
|
// [E8912] Automerge workflow file uses deprecated action or is invalid YAML.
|
|
307
341
|
// [S8913] Suggest to set up automerging.
|
|
308
342
|
// [S8914] Automerging is active but .github/auto-merge.yml not found.
|
|
343
|
+
// [W8915] npm entry has no cooldown or cooldown < 5 days configured.
|
package/package.json
CHANGED