@iobroker/repochecker 5.5.2 → 5.5.3

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
@@ -25,6 +25,10 @@ Example:
25
25
  Placeholder for the next version (at the beginning of the line):
26
26
  ### **WORK IN PROGRESS**
27
27
  -->
28
+ ### 5.5.3 (2026-03-19)
29
+ - (@copilot) Fixed E3016 false positive: transitive `needs` dependencies are now considered, so `deploy` depending on `adapter-tests` which already depends on `check-and-lint` is correctly accepted. Related to [#756].
30
+ - (@copilot) W5041 warning now includes the list of languages that contain the example keys (e.g. `languages: en, de, ru`).
31
+
28
32
  ### 5.5.2 (2026-03-17)
29
33
  - (@copilot) E5040 and W5041 messages now include the specific detected key(s) (e.g. `option1`, `option2`, or both) instead of the generic `option1/option2` placeholder. Only one issue is raised even when multiple keys are detected.
30
34
  - (@copilot) Fixed E1111/W1111 checks: E1111 and W1111 are now renamed to E5040 and W5041 (correct numbering range for M5000_Code module). Both checks now correctly exempt adapters where `option1`/`option2` keys are genuinely used in `admin/index.html`, `admin/index_m.html`, or as keys in `admin/jsonConfig.json`/`admin/jsonConfig.json5`. Related to [#746].
@@ -64,6 +64,41 @@ function jobNeedsAll(job, requiredJobs) {
64
64
  return requiredJobs.every(req => needsArr.includes(req));
65
65
  }
66
66
 
67
+ /**
68
+ * Returns true if the job identified by `startJobName` depends on `requiredJobName`
69
+ * either directly or transitively through the needs chain.
70
+ *
71
+ * @param {object} jobs - All jobs in the workflow (map of job name -> job object)
72
+ * @param {string} startJobName - The job to start the search from
73
+ * @param {string} requiredJobName - The job name that must be reachable via needs
74
+ * @returns {boolean} true if requiredJobName is a direct or transitive dependency of startJobName
75
+ */
76
+ function jobDependsOn(jobs, startJobName, requiredJobName) {
77
+ const visited = new Set();
78
+ const queue = [startJobName];
79
+ while (queue.length > 0) {
80
+ const current = queue.shift();
81
+ if (visited.has(current)) {
82
+ continue;
83
+ }
84
+ visited.add(current);
85
+ const job = jobs[current];
86
+ if (!job || !job.needs) {
87
+ continue;
88
+ }
89
+ const needsArr = Array.isArray(job.needs) ? job.needs : [job.needs];
90
+ if (needsArr.includes(requiredJobName)) {
91
+ return true;
92
+ }
93
+ for (const dep of needsArr) {
94
+ if (!visited.has(dep)) {
95
+ queue.push(dep);
96
+ }
97
+ }
98
+ }
99
+ return false;
100
+ }
101
+
67
102
  async function checkTests(context) {
68
103
  console.log('\n[E3000 - E3999] checking tests');
69
104
 
@@ -278,9 +313,10 @@ async function checkTests(context) {
278
313
  } else {
279
314
  context.checks.push('Job "deploy" found.');
280
315
 
281
- // E3016: deploy must need check-and-lint and adapter-tests, but only if those jobs exist in the workflow
316
+ // E3016: deploy must depend (directly or transitively) on check-and-lint and adapter-tests,
317
+ // but only if those jobs exist in the workflow
282
318
  const requiredDependencies = ['check-and-lint', 'adapter-tests'].filter(j => jobs[j]);
283
- if (!jobNeedsAll(jobs['deploy'], requiredDependencies)) {
319
+ if (!requiredDependencies.every(req => jobDependsOn(jobs, 'deploy', req))) {
284
320
  context.errors.push(
285
321
  `[E3016] Workflow "${WORKFLOW_FILE}": job "deploy" must declare "needs" for both "check-and-lint" and "adapter-tests".`,
286
322
  );
package/lib/M5000_Code.js CHANGED
@@ -277,6 +277,7 @@ async function checkCode(context) {
277
277
  if (!context.hasExampleConfigWarning) {
278
278
  const exampleKeys = ['option1', 'option2'];
279
279
  const foundI18nKeys = new Set();
280
+ const foundI18nLangs = new Set();
280
281
  for (const lang of context.cfg.allowedLanguages) {
281
282
  for (const i18nPath of [`/admin/i18n/${lang}/translations.json`, `/admin/i18n/${lang}.json`]) {
282
283
  if (context[i18nPath]) {
@@ -290,6 +291,9 @@ async function checkCode(context) {
290
291
  for (const key of unusedI18nKeys) {
291
292
  foundI18nKeys.add(key);
292
293
  }
294
+ if (unusedI18nKeys.length) {
295
+ foundI18nLangs.add(lang);
296
+ }lang
293
297
  } catch {
294
298
  // parse errors are reported elsewhere
295
299
  }
@@ -298,8 +302,9 @@ async function checkCode(context) {
298
302
  }
299
303
  if (foundI18nKeys.size) {
300
304
  const keyList = [...foundI18nKeys].join(', ');
305
+ const langList = [...foundI18nLangs].join(', ');
301
306
  context.warnings.push(
302
- `[W5041] Example configuration (${keyList}) found in i18n translation files. Please remove example configuration from your code.`,
307
+ `[W5041] Example configuration (${keyList}) found in i18n translation files (${langList}). Please remove example configuration from your code.`,
303
308
  );
304
309
  context.hasExampleConfigWarning = true;
305
310
  }
@@ -1085,6 +1090,6 @@ exports.checkCode = checkCode;
1085
1090
  // [5038] Conflicting JSON files in directory "${dir}": Both ${baseName}.json and ${baseName}.json5 versions of same file exist. Please remove one.
1086
1091
  // [5039] "admin/words.js" found but not referenced anywhere. File seems to be outdated, please consider removing it.
1087
1092
  // [E5040] Example configuration (option1/option2) found in "native" of io-package.json. Please remove example configuration from your code. (moved from E1111 in M1000)
1088
- // [W5041] Example configuration (option1/option2) found in i18n translation files. Please remove example configuration from your code. (renamed from W1111)
1093
+ // [W5041] Example configuration (option1/option2) found in i18n translation files (en, de, ...). Please remove example configuration from your code. (renamed from W1111)
1089
1094
 
1090
1095
  // [5500 - ] see M5500_jsonConfig.js
@@ -13,6 +13,9 @@ const common = require('./common.js');
13
13
 
14
14
  // German language words blacklist - add new words here to extend detection
15
15
  const GERMAN_WORDS = [
16
+ 'der',
17
+ 'die',
18
+ 'das',
16
19
  'Funktion',
17
20
  'Funktionen',
18
21
  'Voraussetzung',
@@ -25,7 +28,17 @@ const GERMAN_WORDS = [
25
28
  'Einstellungen',
26
29
  'Gerät',
27
30
  'Geräte',
31
+ 'Geräte-Konfiguration',
32
+ 'Gerätekonfiguration',
28
33
  'hinzufügen',
34
+ 'nicht',
35
+ 'blockiert',
36
+ 'ist',
37
+ 'von',
38
+ 'bis',
39
+ 'Wertebereich',
40
+ 'vollständig',
41
+ 'Entwickelt mit Unterstützung von',
29
42
  ];
30
43
 
31
44
  // Common English words used to verify if README is written in English
@@ -287,13 +300,13 @@ async function checkReadme(context) {
287
300
  const germanWord = findGermanWord(data);
288
301
  if (germanWord) {
289
302
  context.errors.push(
290
- `[E6015] README.md appears to be written in German (detected word: "${germanWord}"). README.md must be written in English. Please translate.`,
303
+ `[E6015] README.md appears to be written in German (detected word: "${germanWord}"). README.md must be written using English language only. Please translate.`,
291
304
  );
292
305
  } else {
293
306
  context.checks.push('No German language detected in README.md');
294
307
  if (!isEnglishText(data)) {
295
308
  context.warnings.push(
296
- '[W6016] README.md does not appear to be written in English. README.md must be written in English. Please translate.',
309
+ '[W6016] README.md does not appear to be written in English. README.md must be written using English language only. Please translate.',
297
310
  );
298
311
  } else {
299
312
  context.checks.push('README.md appears to be written in English');
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.5.2",
2
+ "version": "5.5.3",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.18.0",