@iobroker/repochecker 5.22.5 → 5.22.7

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
@@ -56,6 +56,14 @@ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
56
56
  Placeholder for the next version (at the beginning of the line):
57
57
  ### **WORK IN PROGRESS**
58
58
  -->
59
+ ### 5.22.7 (2026-09-25)
60
+ * (mcm57) postprocessing: add per-adapter severity remapping table
61
+
62
+ ### 5.22.6 (2026-09-25)
63
+
64
+ * (mcm1957) @iobroker/testing 6.2.1 is required now
65
+ * (mcm1957) node.js 26 testing is required now
66
+
59
67
  ### 5.22.5 (2026-09-22)
60
68
 
61
69
  * (mcm1957) W5612/E5612 no longer report strings that never need a translation (e.g. "iobroker", "AABBCCDDEEFF"); matched case-insensitively
@@ -122,9 +122,9 @@ const devDependenciesPackageJson = {
122
122
  optional: true,
123
123
  },
124
124
  '@iobroker/testing': {
125
- required: '5.2.2',
126
- recommended: '5.2.2',
127
- actual: '6.2.1',
125
+ required: '6.2.1',
126
+ recommended: '6.2.2',
127
+ actual: '6.2.2',
128
128
  onlyWWW: false,
129
129
  alternatives: ['@iobroker/legacy-testing'],
130
130
  },
package/lib/config.js CHANGED
@@ -443,7 +443,7 @@ const testingNodeJs = {
443
443
  // Node.js versions for the adapter-tests matrix
444
444
  // older versions disallowed by engines clause are removed automatically
445
445
  validMatrixNodeVersions: ['20', '22', '24', '26', '27'], // valid versions to use in testing matrix
446
- requiredMatrixNodeVersions: ['20', '22', '24'], // versions that MUST be present in testing matrix
446
+ requiredMatrixNodeVersions: ['20', '22', '24', '26'], // versions that MUST be present in testing matrix
447
447
  recommendedMatrixNodeVersions: ['22', '24', '26'], // recommended versions that SHOULD be added to testing matrix
448
448
 
449
449
  // Required operating systems for the adapter-tests matrix
@@ -45,6 +45,20 @@ const filterByAdapter = {
45
45
  ],
46
46
  };
47
47
 
48
+ /**
49
+ * Per-adapter severity remapping table (used by remapIssuesByAdapter).
50
+ *
51
+ * Outer key : adapter name without the "ioBroker." prefix, e.g. 'zigbee'.
52
+ * Inner key : issue code, e.g. 'E3025'.
53
+ * Value : target severity – 'E' (error), 'W' (warning), 'S' (suggestion),
54
+ * or 'N' (drop entirely).
55
+ */
56
+ const remapSeverityByAdapter = {
57
+ zigbee: {
58
+ E3025: 'W', // Node 26 test requirement not yet fulfilled; keep visible but reduce to warning
59
+ },
60
+ };
61
+
48
62
  /**
49
63
  * Severity remapping table for new adapters (used by adaptSeverity4New).
50
64
  *
@@ -199,6 +213,87 @@ function filterIssuesByAdapter(context) {
199
213
  return context;
200
214
  }
201
215
 
216
+ /**
217
+ * Remaps the severity of issues for the current adapter according to remapByAdapter.
218
+ *
219
+ * If context.adapterName is not set, or no entry exists for that adapter
220
+ * in remapByAdapter, the function returns immediately without changes.
221
+ *
222
+ * For every remapped issue an info message is logged via common.info().
223
+ * If at least one issue was remapped a summary info is appended to
224
+ * context.warnings.
225
+ *
226
+ * @param {object} context - The checker context
227
+ * @returns {object} The (possibly modified) context
228
+ */
229
+ function remapIssuesByAdapter(context) {
230
+ const adapterName = context.adapterName;
231
+ if (!adapterName) {
232
+ return context;
233
+ }
234
+
235
+ const rules = remapSeverityByAdapter[adapterName];
236
+ if (!rules || Object.keys(rules).length === 0) {
237
+ return context;
238
+ }
239
+
240
+ let remappedCount = 0;
241
+
242
+ /**
243
+ * Scan one issue array in-place: remove matching entries and re-insert
244
+ * them with the new severity.
245
+ *
246
+ * @param {string[]} arr - context.errors or context.warnings
247
+ */
248
+ function processArray(arr) {
249
+ const toReroute = [];
250
+
251
+ for (let i = arr.length - 1; i >= 0; i--) {
252
+ const issue = arr[i];
253
+ const match = issue.match(/^\[([EWSI])(\d+)\]/);
254
+ if (!match) {
255
+ continue;
256
+ }
257
+ const issueKey = match[1] + match[2]; // e.g. "E3025"
258
+ if (!Object.prototype.hasOwnProperty.call(rules, issueKey)) {
259
+ continue;
260
+ }
261
+ const targetSeverity = rules[issueKey];
262
+ common.info(
263
+ `[postprocessing] remapIssuesByAdapter: remapping issue for adapter "${adapterName}" to ${targetSeverity}: ${issue}`,
264
+ );
265
+ arr.splice(i, 1);
266
+ toReroute.push({ targetSeverity, issue });
267
+ remappedCount++;
268
+ }
269
+
270
+ for (const { targetSeverity, issue } of toReroute) {
271
+ if (targetSeverity === 'N') {
272
+ continue; // drop entirely
273
+ }
274
+ // Replace the leading [X####] prefix with the new severity letter
275
+ const newIssue = issue.replace(/^\[([EWSI])(\d+)\]/, `[${targetSeverity}$2]`);
276
+ if (targetSeverity === 'E') {
277
+ context.errors.push(newIssue);
278
+ } else {
279
+ context.warnings.push(newIssue);
280
+ }
281
+ }
282
+ }
283
+
284
+ processArray(context.errors);
285
+ processArray(context.warnings);
286
+
287
+ if (remappedCount > 0) {
288
+ common.info(
289
+ `[postprocessing] remapIssuesByAdapter: ${remappedCount} issue(s) remapped for adapter "${adapterName}".`,
290
+ );
291
+ context.warnings.push(`[S0000] Info: ${remappedCount} issue(s) have adjusted severity for this adapter.`);
292
+ }
293
+
294
+ return context;
295
+ }
296
+
202
297
  /**
203
298
  * Remaps the severity of issues for new adapters according to mapSeverity4New.
204
299
  *
@@ -288,6 +383,7 @@ function postprocessing(context) {
288
383
  console.log('\n[postprocessing] running postprocessing tasks');
289
384
 
290
385
  adaptSeverity4New(context);
386
+ remapIssuesByAdapter(context);
291
387
  filterIssuesByAdapter(context);
292
388
 
293
389
  return context;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.22.5",
2
+ "version": "5.22.7",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.20.0",