@iobroker/repochecker 5.19.0 → 5.19.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
@@ -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.19.1 (2026-06-28)
29
+
30
+ - (mcm1957) checking of untranslated i18n keys has been adapted
31
+
28
32
  ### 5.19.0 (2026-06-27)
29
33
 
30
34
  - (mcm1957) github install detection has been enhanced
@@ -163,6 +163,20 @@ function jobHasStepWithActionInputValue(job, actionPrefix, inputName, expectedVa
163
163
  });
164
164
  }
165
165
 
166
+ function isExplicitlyTrue(value) {
167
+ if (value === true) {
168
+ return true;
169
+ }
170
+ if (typeof value !== 'string') {
171
+ return false;
172
+ }
173
+ return ['true', 'yes', 'on', 'y'].includes(value.trim().toLowerCase());
174
+ }
175
+
176
+ function stepUsesActionPrefix(step, actionPrefix) {
177
+ return typeof step?.uses === 'string' && step.uses.toLowerCase().startsWith(actionPrefix.toLowerCase());
178
+ }
179
+
166
180
  /**
167
181
  * Parses the major version from an action ref string.
168
182
  * Supports values like "v1", "1", "v2.3.4". Returns null for non-numeric refs like branch names.
@@ -751,6 +765,34 @@ async function checkTests(context) {
751
765
  common.debug('testing jobs');
752
766
  const jobs = workflow.jobs || {};
753
767
 
768
+ // W3046 / E3047: "continue-on-error: true" should not be used in test-and-release workflow steps
769
+ const protectedActionPrefixes = [
770
+ 'ioBroker/testing-action-check@',
771
+ 'ioBroker/testing-action-adapter@',
772
+ 'ioBroker/testing-action-deploy@',
773
+ ];
774
+ for (const [jobName, job] of Object.entries(jobs)) {
775
+ if (!Array.isArray(job.steps)) {
776
+ continue;
777
+ }
778
+ for (let i = 0; i < job.steps.length; i++) {
779
+ const step = job.steps[i];
780
+ if (!isExplicitlyTrue(step?.['continue-on-error'])) {
781
+ continue;
782
+ }
783
+
784
+ const stepLabel = typeof step?.name === 'string' && step.name.trim() ? step.name.trim() : `#${i + 1}`;
785
+ const message =
786
+ `Workflow "${WORKFLOW_FILE_SHORT}": job "${jobName}" step "${stepLabel}" uses "continue-on-error: true". ` +
787
+ 'Workflow test-and-release should abort if any error occurs; remove "continue-on-error".';
788
+ if (protectedActionPrefixes.some(prefix => stepUsesActionPrefix(step, prefix))) {
789
+ context.errors.push(`[E3047] ${message}`);
790
+ } else {
791
+ context.warnings.push(`[W3046] ${message}`);
792
+ }
793
+ }
794
+ }
795
+
754
796
  // Compute effective minimum and recommended node.js versions per non-matrix job.
755
797
  // If the engines:node clause in package.json is higher than the config defaults, use that value.
756
798
  const testingCfg = config.testingNodeJs;
@@ -1180,3 +1222,5 @@ exports.checkTests = checkTests;
1180
1222
  // [S3043] Workflow "${WORKFLOW_FILE_SHORT}": job "adapter-tests" uses "ioBroker/testing-action-adapter@${ref}" with a pinned version. Consider locking only the major version.
1181
1223
  // [S3044] Workflow "${WORKFLOW_FILE_SHORT}": job "deploy" uses "ioBroker/testing-action-deploy@${ref}" with a pinned version. Consider locking only the major version.
1182
1224
  // [S3045] Workflow "${WORKFLOW_FILE_SHORT}": job "check-and-lint" should enable linting by setting "lint: true".
1225
+ // [W3046] Workflow "${WORKFLOW_FILE_SHORT}": job "${jobName}" step "${stepLabel}" uses "continue-on-error: true". Workflow test-and-release should abort if any error occurs; remove "continue-on-error".
1226
+ // [E3047] Workflow "${WORKFLOW_FILE_SHORT}": job "${jobName}" step "${stepLabel}" uses "continue-on-error: true". Workflow test-and-release should abort if any error occurs; remove "continue-on-error".
@@ -34,7 +34,7 @@ const TRANSLATABLE_ATTRS = [
34
34
  ];
35
35
  const MAX_W5612_WARNINGS = 10;
36
36
  const MAX_W5606_EXAMPLES = 2;
37
- const MIN_WORDS_FOR_W5606 = 3;
37
+ const MIN_WORDS_FOR_W5606 = 5;
38
38
  const MAX_56XX_ISSUES_PER_CODE = 10;
39
39
  const ISSUE_CODE_56XX_REGEX = /^\[((?:E|W|S)56\d{2})\]/;
40
40
 
@@ -100,14 +100,28 @@ function escapeRegex(str) {
100
100
  }
101
101
 
102
102
  /**
103
- * Count words in a text (words are whitespace-separated tokens).
103
+ * Count actual alphabetic words in a text.
104
+ * Only sequences of alphabetic characters (including accented Latin letters) are counted,
105
+ * so punctuation, brackets, and JSON-like syntax are ignored.
106
+ * This function is intentionally applied to English text only, so Latin Unicode
107
+ * coverage is sufficient.
104
108
  *
105
109
  * @param {string} text - Text to evaluate.
106
- * @returns {number} - Number of words in the text.
110
+ * @returns {number} - Number of alphabetic words in the text.
107
111
  */
108
112
  function countWords(text) {
109
- const trimmed = text.trim();
110
- return trimmed ? trimmed.split(/\s+/).length : 0;
113
+ const words = text.match(/[a-zA-Z\u00C0-\u024F]+/g);
114
+ return words ? words.length : 0;
115
+ }
116
+
117
+ /**
118
+ * Return true if the text contains a URL (http/https scheme or www. prefix).
119
+ *
120
+ * @param {string} text - Text to evaluate.
121
+ * @returns {boolean} - Whether a URL was found.
122
+ */
123
+ function containsUrl(text) {
124
+ return /https?:\/\/|www\./.test(text);
111
125
  }
112
126
 
113
127
  /**
@@ -351,13 +365,14 @@ function checkI18nDirectory(context, i18nDir) {
351
365
  );
352
366
  }
353
367
 
354
- // W5606: Language has untranslated entries identical to English (>=3 words)
368
+ // W5606: Language has untranslated entries identical to English (>3 words)
355
369
  const identical = [...enKeys].filter(
356
370
  k =>
357
371
  langKeys.has(k) &&
358
372
  typeof enTranslations[k] === 'string' &&
359
373
  typeof langTranslations[k] === 'string' &&
360
- countWords(enTranslations[k]) >= MIN_WORDS_FOR_W5606 &&
374
+ !containsUrl(enTranslations[k]) &&
375
+ countWords(enTranslations[k]) > MIN_WORDS_FOR_W5606 &&
361
376
  enTranslations[k] === langTranslations[k],
362
377
  );
363
378
 
@@ -372,7 +387,7 @@ function checkI18nDirectory(context, i18nDir) {
372
387
 
373
388
  if (untranslatedSummary.length > 0) {
374
389
  context.warnings.push(
375
- `[W5606] i18n "${displayDir}" seems to contain untranslated entries identical to English (>=${
390
+ `[W5606] i18n "${displayDir}" seems to contain untranslated entries identical to English (>${
376
391
  MIN_WORDS_FOR_W5606
377
392
  } words). Affected languages: ${untranslatedSummary.map(formatW5606LanguageEntry).join('; ')}.`,
378
393
  );
@@ -655,7 +670,7 @@ exports.getI18nFilesToRead = getI18nFilesToRead;
655
670
  // [W5603] i18n directory is missing a non-required language
656
671
  // [W5604] English translation key not present in another language (missing translation)
657
672
  // [W5605] Translation key in non-English file not present in English (outdated translation)
658
- // [W5606] Non-English translations identical to English (>=3 words), grouped by affected language
673
+ // [W5606] Non-English translations identical to English (>3 words, no URL), grouped by affected language
659
674
  // [E5610] jsonConfig translatable attribute i18n object missing a required language
660
675
  // [W5611] jsonConfig translatable attribute i18n object missing a non-required language
661
676
  // [W5612] jsonConfig translatable attribute string key not found in English translation file
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.19.0",
2
+ "version": "5.19.1",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.20.0",
@@ -9,7 +9,7 @@
9
9
  "js-yaml": "^4.1.1",
10
10
  "json5": "^2.2.3",
11
11
  "minimatch": "^10.0.0",
12
- "semver": "^7.7.4"
12
+ "semver": "^7.8.1"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@alcalzone/release-script": "^5.2.0",