@iobroker/repochecker 2.7.1 → 2.8.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 CHANGED
@@ -20,6 +20,18 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
+ ### 2.8.0 (2024-07-28)
24
+ * (mcm1957) Copyright year check has been fixed for single year entries.
25
+ * (mcm1957) js-controller version check added [#233].
26
+ * (mcm1957) Check for fixed version dependencies and for github dependencies [#233].
27
+ * (mcm1957) Missing language files reduced to warning [#203].
28
+ * (mcm1957) Missing .gitignore is considered an error now.
29
+ * (mcm1957) "common.noConfig" no longer reported as error if "common.adminUI" is present [#245].
30
+ * (mcm1957) "common.noConfig" must match "common.adminUI" setting [#170].
31
+
32
+ ### 2.7.2 (2024-07-26)
33
+ * (mcm1957) package-lock.json check fixed.
34
+
23
35
  ### 2.7.1 (2024-07-26)
24
36
  * (mcm1957) Reduce setTimeout/setInterval error to warning temporary.
25
37
 
package/doc/issues.json CHANGED
@@ -155,6 +155,9 @@
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
+ },
158
161
  "E100": {
159
162
  "title": "Cannot parse io-package.json"
160
163
  },
@@ -515,12 +518,18 @@
515
518
  "E854": {
516
519
  "title": "node_modules not found in "
517
520
  },
521
+ "E901": {
522
+ "title": ".gitignore not found"
523
+ },
518
524
  "E902": {
519
525
  "title": "node_modules not found in .npmignore"
520
526
  },
521
527
  "E903": {
522
528
  "title": "iob_npm.done not found in .gitignore"
523
529
  },
530
+ "E904": {
531
+ "title": "file ${file} found in repository, but not found in .gitignore"
532
+ },
524
533
  "E999": {
525
534
  "title": "GLOBAL ERROR: ${err.toString()}, ${JSON.stringify(err)}"
526
535
  },
@@ -548,6 +557,18 @@
548
557
  "W041": {
549
558
  "title": "`keywords` within package.json should not contain `${forbiddenKeywords.join(', ')}`"
550
559
  },
560
+ "W043": {
561
+ "title": "dependency should not require a github version. Please change `${dependency}:${context.packageJson.dependencies[dependency]}`"
562
+ },
563
+ "W044": {
564
+ "title": "dependency should not require a specific version. Use `~1.2.3` or `^1.2.3` syntax. Please update `${dependency}:${context.packageJson.dependencies[dependency]}`"
565
+ },
566
+ "W045": {
567
+ "title": "devDependency should not require github versions. Please change `${dependency}:${context.packageJson.devDependencies[dependency]}`"
568
+ },
569
+ "W046": {
570
+ "title": "devDependency must not require a specific version. Use `~1.2.3` or `^1.2.3` syntax. Please update `${dependency}:${context.packageJson.devDependencies[dependency]}`"
571
+ },
551
572
  "W105": {
552
573
  "title": "`common.titleLang` should be translated into all supported languages"
553
574
  },
@@ -575,6 +596,9 @@
575
596
  "W156": {
576
597
  "title": "Adapter should support admin 5 UI (jsonConfig) if you do not use a React based UI"
577
598
  },
599
+ "W162": {
600
+ "title": "js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json."
601
+ },
578
602
  "W164": {
579
603
  "title": "Adapters without config `common.noConfig = true` should also set `common.adminUI.config = none`"
580
604
  },
@@ -632,6 +656,9 @@
632
656
  "W505": {
633
657
  "title": "setTimeout found in main, but no clearTimeout detected"
634
658
  },
659
+ "W510": {
660
+ "title": "`/admin/i18n/${lang}/translations.json` or `admin/i18n/${lang}.json` not found, but admin support is declared. Please add."
661
+ },
635
662
  "W513": {
636
663
  "title": "`gulpfile.js` found in repo! Think about migrating to @iobroker/adapter-dev package"
637
664
  },
@@ -647,6 +674,9 @@
647
674
  "W522": {
648
675
  "title": "Please consider migrating to admin 5 UI (jsonConfig)."
649
676
  },
677
+ "W523": {
678
+ "title": "`package-lock.json` not found in repo! Please remove from .gitignore!"
679
+ },
650
680
  "W606": {
651
681
  "title": "Could not retrieve timestamp of LATEST revision at npm."
652
682
  },
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,40 @@ 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('^') && !context.packageJson.dependencies[dependency].startsWith('~') ) {
577
+ if (context.packageJson.dependencies[dependency].toLowerCase().includes('github.com')) {
578
+ context.warnings.push(`[W043] dependency should not require a github version. Please change "${dependency}:${context.packageJson.dependencies[dependency]}"`);
579
+ } else if (enforcedDependencies.includes(dependency)){
580
+ 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]}"`);
581
+ } else {
582
+ 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]}"`);
583
+ }
584
+ }
585
+ }
586
+
587
+ for (const dependency in context.packageJson.devDependencies) {
588
+ if (!context.packageJson.devDependencies[dependency].startsWith('^') && !context.packageJson.devDependencies[dependency].startsWith('~') ) {
589
+ if (context.packageJson.devDependencies[dependency].toLowerCase().includes('github.com')) {
590
+ context.warnings.push(`[W045] devDependency should not require github versions. Please change "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
591
+ } else if (enforcedDependencies.includes(dependency)){
592
+ context.errors.push(`[W046] devDependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
593
+ } else {
594
+ 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]}"`);
595
+ }
596
+ }
597
+ }
557
598
 
558
599
  for (const blacklist in blacklistPackageJson) {
559
600
  //console.log(`checking blacklist ${blacklist}`);
@@ -610,7 +651,7 @@ function checkPackageJson(context) {
610
651
  context.checks.push('"globalDependencies" not found in package.json');
611
652
  }
612
653
 
613
- // max number is W042
654
+ // max number is W046
614
655
 
615
656
  return context;
616
657
  });
@@ -1264,26 +1305,20 @@ function checkIOPackageJson(context) {
1264
1305
  context.checks.push('"common.compact" found in io-package.json');
1265
1306
  }
1266
1307
 
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
- //}
1308
+ if (context.ioPackageJson.common.noConfig &&
1309
+ (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config !== 'none')
1310
+ ) {
1311
+ context.errors.push('[E114] "common.noConfig=true" requires "common.adminUI.config" to be set to "none"' );
1312
+ }
1313
+ if (!context.ioPackageJson.common.materialize &&
1314
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') &&
1315
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize') &&
1316
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'html') &&
1317
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'none')
1318
+ ) {
1319
+ 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
1320
  } 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
- }
1321
+ context.checks.push('"common.materialize" or valid "common.adminUI.config:xxx" found in io-package.json');
1287
1322
  }
1288
1323
 
1289
1324
  if (context.ioPackageJson.common.license) {
@@ -1508,11 +1543,29 @@ function checkIOPackageJson(context) {
1508
1543
  } else {
1509
1544
  currentJsControllerVersion = jsControllerDependency['js-controller'].replace(/[^\d.]/g, '');
1510
1545
  }
1546
+ } else {
1547
+ 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
1548
  }
1512
-
1513
1549
  }
1514
1550
  }
1515
1551
 
1552
+ /*
1553
+ increase dependency as required by addition features
1554
+ */
1555
+ if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.supportedMessges) {
1556
+ requiredJsControllerVersion = maxVersion( requiredJsControllerVersion, '5.0.18');
1557
+ }
1558
+ if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.nodeProcessParams) {
1559
+ requiredJsControllerVersion = maxVersion( requiredJsControllerVersion, '5.0.18');
1560
+ }
1561
+
1562
+
1563
+ if ( currentJsControllerVersion && compareVersions.compare( requiredJsControllerVersion, currentJsControllerVersion, '>=' )) {
1564
+ 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.`);
1565
+ } else if ( currentJsControllerVersion && compareVersions.compare( recommendedJsControllerVersion, currentJsControllerVersion, '>=' )) {
1566
+ context.warnings.push(`[W162] js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json.`);
1567
+ }
1568
+
1516
1569
  if (context.ioPackageJson.common.globalDependencies) {
1517
1570
  const dependencyArray = getDependencyArray(context.ioPackageJson.common.globalDependencies);
1518
1571
 
@@ -1528,67 +1581,6 @@ function checkIOPackageJson(context) {
1528
1581
  }
1529
1582
 
1530
1583
 
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
1584
  if (!context.ioPackageJson.common.onlyWWW) {
1593
1585
  if (!context.ioPackageJson.common.tier) {
1594
1586
  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.`);
@@ -2293,12 +2285,12 @@ function checkCode(context) {
2293
2285
  context.errors.push(`[E509] Cannot parse "admin/i18n/${lang}.json": ${e}`);
2294
2286
  }
2295
2287
  } else {
2296
- context.errors.push(`[E510] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared`);
2288
+ context.warnings.push(`[W510] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared. Please add.`);
2297
2289
  }
2298
2290
  });
2299
2291
  }
2300
2292
  if (jsonConfig && jsonConfig.i18n === false) {
2301
- context.warnings.push(`[W515] Why you decided to disable i18n support?`);
2293
+ context.warnings.push(`[W515] Why did you decide to disable i18n support?`);
2302
2294
  }
2303
2295
  }
2304
2296
 
@@ -2331,8 +2323,8 @@ function checkCode(context) {
2331
2323
  context.errors.push('[E503] "iob_npm.done" found in repo! Remove that file');
2332
2324
  }
2333
2325
 
2334
- if (!context['/package-lock.json']) {
2335
- context.warnings.push('[W522] "package-lock.json" not found in repo! Please remove from .gitignore!');
2326
+ if (!context.filesList.includes('package-lock.json')) {
2327
+ context.warnings.push('[W523] "package-lock.json" not found in repo! Please remove from .gitignore!');
2336
2328
  }
2337
2329
 
2338
2330
  if (context['/.travis.yml']) {
@@ -2381,7 +2373,7 @@ function checkCode(context) {
2381
2373
  }
2382
2374
  }
2383
2375
  }
2384
- // max E521
2376
+ // max E523
2385
2377
  resolve(context);
2386
2378
  })
2387
2379
  .catch(e => reject(e));
@@ -2444,8 +2436,8 @@ function checkReadme(context) {
2444
2436
  console.log(`[DEBUG] ${latest} - ${timeStr} - ${npmYear}`);
2445
2437
  }
2446
2438
  } catch (e) {
2447
- context.Warnings.push('[W606] Could not retrieve timestamp of LATEST revision at npm.');
2448
- console.log(`Error executing "npm view" - ${e}`);
2439
+ context.warnings.push('[W606] Could not retrieve timestamp of LATEST revision at npm.');
2440
+ console.log(`Error executing "npm view"`);
2449
2441
  }
2450
2442
 
2451
2443
  const pos = data.indexOf('## License');
@@ -2460,12 +2452,14 @@ function checkReadme(context) {
2460
2452
  let m = text.match(/\d\d\d\d-(\d\d\d\d)/);
2461
2453
  if (m) {
2462
2454
  readmeYear = Number(m[1]);
2463
- } else {
2464
- m = text.match(/(\d\d\d\d)/);
2465
- if (m) {
2455
+ }
2456
+ m = text.match(/(\d\d\d\d)/); /* both variants could be present */
2457
+ if (m) {
2458
+ if (Number(m[1]) > readmeYear) {
2466
2459
  readmeYear = Number(m[1]);
2467
2460
  }
2468
2461
  }
2462
+
2469
2463
  console.log(`README year ${readmeYear}`);
2470
2464
  console.log(`Current year ${year}`);
2471
2465
  console.log(`Commit year ${commitYear}`);
@@ -2529,12 +2523,14 @@ function checkLicenseFile(context) {
2529
2523
  let m = text.match(/\d\d\d\d-(\d\d\d\d)/);
2530
2524
  if (m) {
2531
2525
  licenseYear = Number(m[1]);
2532
- } else {
2533
- m = text.match(/(\d\d\d\d)/);
2534
- if (m) {
2526
+ }
2527
+ m = text.match(/(\d\d\d\d)/);
2528
+ if (m) {
2529
+ if (Number(m[1])>licenseYear) {
2535
2530
  licenseYear = Number(m[1]);
2536
2531
  }
2537
2532
  }
2533
+
2538
2534
  console.log(`License year ${licenseYear}`);
2539
2535
  console.log(`Current year ${year}`);
2540
2536
  console.log(`Commit year ${commitYear}`);
@@ -2692,7 +2688,7 @@ function checkGitIgnore(context) {
2692
2688
  // https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/.gitignore
2693
2689
  console.log('\ncheckGitIgnore [E9xx]');
2694
2690
  if (!context.filesList.includes('.gitignore')) {
2695
- context.warnings.push(`[W901] .gitignore not found`);
2691
+ context.errors.push(`[E901] .gitignore not found`);
2696
2692
  } else {
2697
2693
  const rules = (context['/.gitignore'] || '').split('\n').map(line => line.trim().replace('\r', '')).filter(line => line);
2698
2694
  rules.forEach((name, i) => {
@@ -2724,7 +2720,7 @@ function checkGitIgnore(context) {
2724
2720
  }
2725
2721
  });
2726
2722
 
2727
- !check && context.errors.push(`[E9${paddingNum(i + 11)}] file ${file} found in repository, but not found in .gitignore`);
2723
+ !check && context.errors.push(`[E904] file ${file} found in repository, but not found in .gitignore`);
2728
2724
  }
2729
2725
  });
2730
2726
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.7.1",
2
+ "version": "2.8.0",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.7.2",