@iobroker/repochecker 2.7.2 → 2.8.1

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 CHANGED
@@ -20,6 +20,19 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
+ ### 2.8.1 (2024-07-28)
24
+ * (mcm1957) Check of js-controller version has been corrected [#247].
25
+ * (mcm1957) Honor '>' at dependency checks too [#246].
26
+
27
+ ### 2.8.0 (2024-07-28)
28
+ * (mcm1957) Copyright year check has been fixed for single year entries.
29
+ * (mcm1957) js-controller version check added [#233].
30
+ * (mcm1957) Check for fixed version dependencies and for github dependencies [#233].
31
+ * (mcm1957) Missing language files reduced to warning [#203].
32
+ * (mcm1957) Missing .gitignore is considered an error now.
33
+ * (mcm1957) "common.noConfig" no longer reported as error if "common.adminUI" is present [#245].
34
+ * (mcm1957) "common.noConfig" must match "common.adminUI" setting [#170].
35
+
23
36
  ### 2.7.2 (2024-07-26)
24
37
  * (mcm1957) package-lock.json check fixed.
25
38
 
package/doc/issues.json CHANGED
@@ -155,6 +155,12 @@
155
155
  "E042": {
156
156
  "title": "`globalDependencies` is misplaced at package.json. Did you mean `common.globalDependencies` at io-package.json?"
157
157
  },
158
+ "E044": {
159
+ "title": "dependency must not require a specific version. Use `~1.2.3` or `^1.2.3` syntax. Please update `${dependency}:${context.packageJson.dependencies[dependency]}`"
160
+ },
161
+ "E046": {
162
+ "title": "devDependency must not require a specific version. Use `~1.2.3` or `^1.2.3` syntax. Please update `${dependency}:${context.packageJson.devDependencies[dependency]}`"
163
+ },
158
164
  "E100": {
159
165
  "title": "Cannot parse io-package.json"
160
166
  },
@@ -354,7 +360,7 @@
354
360
  "title": "Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: `npm owner add bluefox iobroker.adapterName`"
355
361
  },
356
362
  "E204": {
357
- "title": "Version(s) `${missingVersions.join(`, `)}` listed at common.news at io-package.json do not exist at NPM. Please remove from news."
363
+ "title": "Version `${missingVersions.join(`, `)}` listed at common.news at io-package.json does not exist at NPM. Please remove from news."
358
364
  },
359
365
  "E300": {
360
366
  "title": "Not found on travis. Please setup travis or use github actions (preferred)"
@@ -515,12 +521,18 @@
515
521
  "E854": {
516
522
  "title": "node_modules not found in "
517
523
  },
524
+ "E901": {
525
+ "title": ".gitignore not found"
526
+ },
518
527
  "E902": {
519
528
  "title": "node_modules not found in .npmignore"
520
529
  },
521
530
  "E903": {
522
531
  "title": "iob_npm.done not found in .gitignore"
523
532
  },
533
+ "E904": {
534
+ "title": "file ${file} found in repository, but not found in .gitignore"
535
+ },
524
536
  "E999": {
525
537
  "title": "GLOBAL ERROR: ${err.toString()}, ${JSON.stringify(err)}"
526
538
  },
@@ -548,6 +560,18 @@
548
560
  "W041": {
549
561
  "title": "`keywords` within package.json should not contain `${forbiddenKeywords.join(', ')}`"
550
562
  },
563
+ "W043": {
564
+ "title": "dependency should not require a github version. Please change `${dependency}:${context.packageJson.dependencies[dependency]}`"
565
+ },
566
+ "W044": {
567
+ "title": "dependency should not require a specific version. Use `~1.2.3` or `^1.2.3` syntax. Please update `${dependency}:${context.packageJson.dependencies[dependency]}`"
568
+ },
569
+ "W045": {
570
+ "title": "devDependency should not require github versions. Please change `${dependency}:${context.packageJson.devDependencies[dependency]}`"
571
+ },
572
+ "W046": {
573
+ "title": "devDependency should not require a specific version. Use `~1.2.3` or `^1.2.3` syntax. Please update `${dependency}:${context.packageJson.devDependencies[dependency]}`"
574
+ },
551
575
  "W105": {
552
576
  "title": "`common.titleLang` should be translated into all supported languages"
553
577
  },
@@ -575,6 +599,9 @@
575
599
  "W156": {
576
600
  "title": "Adapter should support admin 5 UI (jsonConfig) if you do not use a React based UI"
577
601
  },
602
+ "W162": {
603
+ "title": "js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json."
604
+ },
578
605
  "W164": {
579
606
  "title": "Adapters without config `common.noConfig = true` should also set `common.adminUI.config = none`"
580
607
  },
@@ -632,6 +659,9 @@
632
659
  "W505": {
633
660
  "title": "setTimeout found in main, but no clearTimeout detected"
634
661
  },
662
+ "W510": {
663
+ "title": "`/admin/i18n/${lang}/translations.json` or `admin/i18n/${lang}.json` not found, but admin support is declared. Please add."
664
+ },
635
665
  "W513": {
636
666
  "title": "`gulpfile.js` found in repo! Think about migrating to @iobroker/adapter-dev package"
637
667
  },
package/index.js CHANGED
@@ -36,18 +36,19 @@ axios.defaults.headers = {
36
36
 
37
37
  // adapt recommended version here
38
38
  // outdated? // const recommendedAdapterCoreVersion = '3.0.6';
39
- const recommendedJsControllerVersion = '5.0.11';
39
+ const recommendedJsControllerVersion = '5.0.19';
40
+ let requiredJsControllerVersion = '4.0.24';
40
41
  const recommendedNodeVersion = '18'; // This is the minimum node version which should be required
41
42
  const requiredNodeVersion = '16'; // This is the minimum node version which must be required
42
43
 
43
- const dependencies = {
44
+ const dependenciesPackageJson = {
44
45
  "@iobroker/adapter-core": {
45
46
  "required":"3.1.4",
46
47
  "recommended":"3.1.6"
47
48
  }
48
49
  };
49
50
 
50
- const devDependencies = {
51
+ const devDependenciesPackageJson = {
51
52
  "@iobroker/testing": {
52
53
  "required":"4.1.3",
53
54
  "recommended":"4.1.3",
@@ -182,6 +183,13 @@ function getDependencies(deps) {
182
183
  return ret;
183
184
  }
184
185
 
186
+ /*
187
+ return the greater of two semver versions
188
+ */
189
+ function maxVersion (v1, v1){
190
+ if ( compareVersions.compareversion( v1, v2 ) > 0) return v1; else return v2;
191
+ }
192
+
185
193
  /*
186
194
  function checkLanguages(langObj) {
187
195
  if (Object.keys(langObj).length !== allowedLanguages.length) return false;
@@ -517,9 +525,9 @@ function checkPackageJson(context) {
517
525
  }
518
526
 
519
527
  if (!context.ioPackageJson.common.onlyWWW) {
520
- for (const dependency in dependencies) {
521
- const requiredVersion = dependencies[dependency].required;
522
- const recommendedVersion = dependencies[dependency].recommended;
528
+ for (const dependency in dependenciesPackageJson) {
529
+ const requiredVersion = dependenciesPackageJson[dependency].required;
530
+ const recommendedVersion = dependenciesPackageJson[dependency].recommended;
523
531
  let dependencyVersion = context.packageJson.dependencies[`${dependency}`] || '';
524
532
  dependencyVersion = dependencyVersion.replace(/[\^\~]/,'' );
525
533
  if (!dependencyVersion) {
@@ -532,15 +540,15 @@ function checkPackageJson(context) {
532
540
  context.checks.push('dependency ${dependency} ${dependencyVersion} is ok');
533
541
  }
534
542
  }
535
- context.checks.push('"dependencies" checked.');
543
+ context.checks.push('"dependenciesPackageJson" checked.');
536
544
  } else {
537
- context.checks.push('"dependencies" check skipped for wwwOnly adapter.');
545
+ context.checks.push('"dependenciesPackageJson" check skipped for wwwOnly adapter.');
538
546
  }
539
547
 
540
- for (const dependency in devDependencies) {
541
- if ((devDependencies[dependency].onlyWWW === false) && context.ioPackageJson.common.onlyWWW) continue;
542
- const requiredVersion = devDependencies[dependency].required;
543
- const recommendedVersion = devDependencies[dependency].recommended;
548
+ for (const dependency in devDependenciesPackageJson) {
549
+ if ((devDependenciesPackageJson[dependency].onlyWWW === false) && context.ioPackageJson.common.onlyWWW) continue;
550
+ const requiredVersion = devDependenciesPackageJson[dependency].required;
551
+ const recommendedVersion = devDependenciesPackageJson[dependency].recommended;
544
552
  let dependencyVersion = context.packageJson.devDependencies[`${dependency}`] || '';
545
553
  dependencyVersion = dependencyVersion.replace(/[\^\~]/,'' );
546
554
  if (!dependencyVersion) {
@@ -553,7 +561,46 @@ function checkPackageJson(context) {
553
561
  context.checks.push('devDependency ${dependency} ${dependencyVersion} is ok');
554
562
  }
555
563
  }
556
- context.checks.push('"devDependencies" checked.');
564
+ context.checks.push('"devDependenciesPackageJson" checked.');
565
+
566
+ const enforcedDependencies = [
567
+ "@iobroker/adapter-core",
568
+ "@alcalzone/release-script",
569
+ "@alcalzone/release-script-plugin-iobroker",
570
+ "@alcalzone/release-script-plugin-license",
571
+ "@alcalzone/release-script-manual-review",
572
+ "@iobroker/adapter-dev",
573
+ "@iobroker/testing"
574
+ ]
575
+ for (const dependency in context.packageJson.dependencies) {
576
+ if (!context.packageJson.dependencies[dependency].startsWith('^') &&
577
+ !context.packageJson.dependencies[dependency].startsWith('~') &&
578
+ !context.packageJson.dependencies[dependency].startsWith('>')
579
+ ) {
580
+ if (context.packageJson.dependencies[dependency].toLowerCase().includes('github.com')) {
581
+ context.warnings.push(`[W043] dependency should not require a github version. Please change "${dependency}:${context.packageJson.dependencies[dependency]}"`);
582
+ } else if (enforcedDependencies.includes(dependency)){
583
+ context.errors.push(`[E044] dependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"`);
584
+ } else {
585
+ context.warnings.push(`[W044] dependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"`);
586
+ }
587
+ }
588
+ }
589
+
590
+ for (const dependency in context.packageJson.devDependencies) {
591
+ if (!context.packageJson.devDependencies[dependency].startsWith('^') &&
592
+ !context.packageJson.devDependencies[dependency].startsWith('~') &&
593
+ !context.packageJson.devDependencies[dependency].startsWith('>')
594
+ ) {
595
+ if (context.packageJson.devDependencies[dependency].toLowerCase().includes('github.com')) {
596
+ context.warnings.push(`[W045] devDependency should not require github versions. Please change "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
597
+ } else if (enforcedDependencies.includes(dependency)){
598
+ context.errors.push(`[E046] devDependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
599
+ } else {
600
+ context.warnings.push(`[W046] devDependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
601
+ }
602
+ }
603
+ }
557
604
 
558
605
  for (const blacklist in blacklistPackageJson) {
559
606
  //console.log(`checking blacklist ${blacklist}`);
@@ -610,7 +657,7 @@ function checkPackageJson(context) {
610
657
  context.checks.push('"globalDependencies" not found in package.json');
611
658
  }
612
659
 
613
- // max number is W042
660
+ // max number is W046
614
661
 
615
662
  return context;
616
663
  });
@@ -1264,26 +1311,20 @@ function checkIOPackageJson(context) {
1264
1311
  context.checks.push('"common.compact" found in io-package.json');
1265
1312
  }
1266
1313
 
1267
- if (!context.ioPackageJson.common.noConfig) {
1268
- if (!context.ioPackageJson.common.materialize &&
1269
- !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') &&
1270
- !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')
1271
- ) {
1272
- context.errors.push('[E114] No adapter are allowed in the repo without admin support (set "common.noConfig = true" and "common.adminUI.config = none" if adapter has no configuration)');
1273
- } else {
1274
- context.checks.push('"common.materialize" or "common.adminUI.config" found in io-package.json');
1275
- }
1276
-
1277
- // check moved to W520
1278
- //if (!context.ioPackageJson.common.adminUI || (context.ioPackageJson.common.adminUI.config !== 'json' && context.ioPackageJson.common.adminUI.config !== 'none')) {
1279
- // context.warnings.push('[W156] Adapter should support admin 5 UI (jsonConfig) if you do not use a React based UI');
1280
- //}
1314
+ if (context.ioPackageJson.common.noConfig &&
1315
+ (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config !== 'none')
1316
+ ) {
1317
+ context.errors.push('[E114] "common.noConfig=true" requires "common.adminUI.config" to be set to "none"' );
1318
+ }
1319
+ if (!context.ioPackageJson.common.materialize &&
1320
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') &&
1321
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize') &&
1322
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'html') &&
1323
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'none')
1324
+ ) {
1325
+ context.errors.push('[E114] No adapter are allowed in the repo without admin support (set "common.adminUI.config = none" if adapter has no configuration)');
1281
1326
  } else {
1282
- context.checks.push('adapter has no admin config');
1283
-
1284
- if (!context.ioPackageJson.common.adminUI || context.ioPackageJson.common.adminUI.config !== 'none') {
1285
- context.warnings.push('[W164] Adapters without config "common.noConfig = true" should also set "common.adminUI.config = none"');
1286
- }
1327
+ context.checks.push('"common.materialize" or valid "common.adminUI.config:xxx" found in io-package.json');
1287
1328
  }
1288
1329
 
1289
1330
  if (context.ioPackageJson.common.license) {
@@ -1508,11 +1549,29 @@ function checkIOPackageJson(context) {
1508
1549
  } else {
1509
1550
  currentJsControllerVersion = jsControllerDependency['js-controller'].replace(/[^\d.]/g, '');
1510
1551
  }
1552
+ } else {
1553
+ context.errors.push(`[E162] js-controller dependency missing. js-controller ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please add to dependencies at io-package.json.`);
1511
1554
  }
1512
-
1513
1555
  }
1514
1556
  }
1515
1557
 
1558
+ /*
1559
+ increase dependency as required by addition features
1560
+ */
1561
+ if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.supportedMessges) {
1562
+ requiredJsControllerVersion = maxVersion( requiredJsControllerVersion, '5.0.18');
1563
+ }
1564
+ if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.nodeProcessParams) {
1565
+ requiredJsControllerVersion = maxVersion( requiredJsControllerVersion, '5.0.18');
1566
+ }
1567
+
1568
+
1569
+ if ( currentJsControllerVersion && compareVersions.compare( requiredJsControllerVersion, currentJsControllerVersion, '>=' )) {
1570
+ context.errors.push(`[E162] js-controller ${currentJsControllerVersion} listed as dependency but ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please update dependency at io-package.json.`);
1571
+ } else if ( currentJsControllerVersion && compareVersions.compare( recommendedJsControllerVersion, currentJsControllerVersion, '>' )) {
1572
+ context.warnings.push(`[W162] js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json.`);
1573
+ }
1574
+
1516
1575
  if (context.ioPackageJson.common.globalDependencies) {
1517
1576
  const dependencyArray = getDependencyArray(context.ioPackageJson.common.globalDependencies);
1518
1577
 
@@ -1528,67 +1587,6 @@ function checkIOPackageJson(context) {
1528
1587
  }
1529
1588
 
1530
1589
 
1531
- if (context.packageJson.dependencies && context.packageJson.dependencies['@iobroker/adapter-core']) {
1532
- /*
1533
- - adapter-core <2.3 has no special dep requirements
1534
- - adapter-core 2.3.x requires js-controller 1.5.8+ as dep
1535
- - adapter-core 2.4.0+ required js-controller 2.0.0+ as dep
1536
- */
1537
- if (context.packageJson.dependencies['@iobroker/adapter-core'].includes('2.3')) {
1538
- if (!context.ioPackageJson.common.dependencies) {
1539
- context.errors.push(`[E153] common.dependencies must contain {"js-controller": ">=1.5.8"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1540
- } else {
1541
- if (currentJsControllerVersion) {
1542
- if (!compareVersions.compare(currentJsControllerVersion, '1.5.8', '>=')) {
1543
- context.errors.push(`[E153] common.dependencies must contain {"js-controller": ">=1.5.8"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1544
- } else {
1545
- context.checks.push('adapter-core 2.3 dependency matches js-controller dependency');
1546
- }
1547
- } else {
1548
- context.errors.push(`[E153] common.dependencies must contain {"js-controller": ">=1.5.8"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1549
- }
1550
- }
1551
- } else if (context.packageJson.dependencies['@iobroker/adapter-core'].includes('2.4') || context.packageJson.dependencies['@iobroker/adapter-core'].includes('2.5') || context.packageJson.dependencies['@iobroker/adapter-core'].includes('2.6')) {
1552
- if (!context.ioPackageJson.common.dependencies) {
1553
- context.errors.push(`[E154] common.dependencies must contain [{"js-controller": ">=2.0.0"}] or later - recommended: [{"js-controller": ">=${recommendedJsControllerVersion}"}]`);
1554
- } else {
1555
- if (currentJsControllerVersion) {
1556
- if (!compareVersions.compare(currentJsControllerVersion, '2.0.0', '>=')) {
1557
- context.errors.push(`[E154] common.dependencies must contain [{"js-controller": ">=2.0.0"}] or later - recommended: [{"js-controller": ">=${recommendedJsControllerVersion}"}]`);
1558
- } else {
1559
- context.checks.push('adapter-core >=2.4 dependency matches js-controller dependency');
1560
- }
1561
- } else {
1562
- context.errors.push(`[E154] common.dependencies must contain {"js-controller": ">=2.0.0"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1563
- }
1564
- }
1565
- }
1566
- }
1567
-
1568
- if (context.ioPackageJson.common.protectedNative) {
1569
- if (!currentJsControllerVersion) {
1570
- context.errors.push(`[E157] common.protectedNative requires dependency {"js-controller": ">=2.0.2"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1571
- } else if (!compareVersions.compare(currentJsControllerVersion, '2.0.2', '>=')) {
1572
- context.errors.push(`[E157] common.protectedNative requires dependency {"js-controller": ">=2.0.2"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1573
- }
1574
- }
1575
-
1576
- if (context.ioPackageJson.common.encryptedNative) {
1577
- if (!currentJsControllerVersion) {
1578
- context.errors.push(`[E158] common.encryptedNative requires dependency {"js-controller": ">=3.0.3"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1579
- } else if (!compareVersions.compare(currentJsControllerVersion, '3.0.3', '>=')) {
1580
- context.errors.push(`[E158] common.encryptedNative requires dependency {"js-controller": ">=3.0.3"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1581
- }
1582
- }
1583
-
1584
- if (context.ioPackageJson.common.notifications) {
1585
- if (!currentJsControllerVersion) {
1586
- context.errors.push(`[E168] common.notifications requires dependency {"js-controller": ">=3.2.0"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1587
- } else if (!compareVersions.compare(currentJsControllerVersion, '3.2.0', '>=')) {
1588
- context.errors.push(`[E168] common.notifications requires dependency {"js-controller": ">=3.2.0"} or later - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}`);
1589
- }
1590
- }
1591
-
1592
1590
  if (!context.ioPackageJson.common.onlyWWW) {
1593
1591
  if (!context.ioPackageJson.common.tier) {
1594
1592
  context.warnings.push(`[W115] \"common.tier\" is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.`);
@@ -1754,7 +1752,11 @@ function checkNpm(context) {
1754
1752
  }
1755
1753
  }
1756
1754
  if (missingVersions.length) {
1757
- context.errors.push(`[E204] Version(s) "${missingVersions.join(", ")}" listed at common.news at io-package.json do not exist at NPM. Please remove from news.`);
1755
+ if (missingVersions.length == 1) {
1756
+ context.errors.push(`[E204] Version "${missingVersions.join(", ")}" listed at common.news at io-package.json does not exist at NPM. Please remove from news.`);
1757
+ } else {
1758
+ context.errors.push(`[E204] Versions "${missingVersions.join(", ")}" listed at common.news at io-package.json do not exist at NPM. Please remove from news.`);
1759
+ }
1758
1760
  } else {
1759
1761
  context.checks.push(`All versions listed at news exist at npm`);
1760
1762
  }
@@ -2293,12 +2295,12 @@ function checkCode(context) {
2293
2295
  context.errors.push(`[E509] Cannot parse "admin/i18n/${lang}.json": ${e}`);
2294
2296
  }
2295
2297
  } else {
2296
- context.errors.push(`[E510] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared`);
2298
+ context.warnings.push(`[W510] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared. Please add.`);
2297
2299
  }
2298
2300
  });
2299
2301
  }
2300
2302
  if (jsonConfig && jsonConfig.i18n === false) {
2301
- context.warnings.push(`[W515] Why you decided to disable i18n support?`);
2303
+ context.warnings.push(`[W515] Why did you decide to disable i18n support?`);
2302
2304
  }
2303
2305
  }
2304
2306
 
@@ -2444,8 +2446,8 @@ function checkReadme(context) {
2444
2446
  console.log(`[DEBUG] ${latest} - ${timeStr} - ${npmYear}`);
2445
2447
  }
2446
2448
  } catch (e) {
2447
- context.Warnings.push('[W606] Could not retrieve timestamp of LATEST revision at npm.');
2448
- console.log(`Error executing "npm view" - ${e}`);
2449
+ context.warnings.push('[W606] Could not retrieve timestamp of LATEST revision at npm.');
2450
+ console.log(`Error executing "npm view"`);
2449
2451
  }
2450
2452
 
2451
2453
  const pos = data.indexOf('## License');
@@ -2460,12 +2462,14 @@ function checkReadme(context) {
2460
2462
  let m = text.match(/\d\d\d\d-(\d\d\d\d)/);
2461
2463
  if (m) {
2462
2464
  readmeYear = Number(m[1]);
2463
- } else {
2464
- m = text.match(/(\d\d\d\d)/);
2465
- if (m) {
2465
+ }
2466
+ m = text.match(/(\d\d\d\d)/); /* both variants could be present */
2467
+ if (m) {
2468
+ if (Number(m[1]) > readmeYear) {
2466
2469
  readmeYear = Number(m[1]);
2467
2470
  }
2468
2471
  }
2472
+
2469
2473
  console.log(`README year ${readmeYear}`);
2470
2474
  console.log(`Current year ${year}`);
2471
2475
  console.log(`Commit year ${commitYear}`);
@@ -2529,12 +2533,14 @@ function checkLicenseFile(context) {
2529
2533
  let m = text.match(/\d\d\d\d-(\d\d\d\d)/);
2530
2534
  if (m) {
2531
2535
  licenseYear = Number(m[1]);
2532
- } else {
2533
- m = text.match(/(\d\d\d\d)/);
2534
- if (m) {
2536
+ }
2537
+ m = text.match(/(\d\d\d\d)/);
2538
+ if (m) {
2539
+ if (Number(m[1])>licenseYear) {
2535
2540
  licenseYear = Number(m[1]);
2536
2541
  }
2537
2542
  }
2543
+
2538
2544
  console.log(`License year ${licenseYear}`);
2539
2545
  console.log(`Current year ${year}`);
2540
2546
  console.log(`Commit year ${commitYear}`);
@@ -2692,7 +2698,7 @@ function checkGitIgnore(context) {
2692
2698
  // https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/.gitignore
2693
2699
  console.log('\ncheckGitIgnore [E9xx]');
2694
2700
  if (!context.filesList.includes('.gitignore')) {
2695
- context.warnings.push(`[W901] .gitignore not found`);
2701
+ context.errors.push(`[E901] .gitignore not found`);
2696
2702
  } else {
2697
2703
  const rules = (context['/.gitignore'] || '').split('\n').map(line => line.trim().replace('\r', '')).filter(line => line);
2698
2704
  rules.forEach((name, i) => {
@@ -2724,7 +2730,7 @@ function checkGitIgnore(context) {
2724
2730
  }
2725
2731
  });
2726
2732
 
2727
- !check && context.errors.push(`[E9${paddingNum(i + 11)}] file ${file} found in repository, but not found in .gitignore`);
2733
+ !check && context.errors.push(`[E904] file ${file} found in repository, but not found in .gitignore`);
2728
2734
  }
2729
2735
  });
2730
2736
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.7.2",
2
+ "version": "2.8.1",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.7.2",