@iobroker/repochecker 4.2.0-alpha.6 → 4.2.1-alpha.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 +5 -5
- package/lib/M500_Code.js +40 -28
- package/lib/M800_Github.js +8 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,15 +31,15 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
|
|
|
31
31
|
Placeholder for the next version (at the beginning of the line):
|
|
32
32
|
### **WORK IN PROGRESS**
|
|
33
33
|
-->
|
|
34
|
+
### 4.2.1-alpha.0 (2025-09-27)
|
|
35
|
+
- (@copilot) Added structured GitHub issue templates for bug reports, false positives, new checks, check changes, and enhancements
|
|
36
|
+
- (@copilot) Fixed deprecated function checking for adapter methods called outside class context
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- (mcm1957) 'Request replacement text changed to suggest node:fetch [#498].
|
|
38
|
+
### 4.2.0 (2025-09-20)
|
|
39
|
+
- (mcm1957) 'Request' replacement text changed to suggest 'node:fetch' [#498].
|
|
38
40
|
- (@copilot) Fixed false positive W533 warnings for deprecated adapter methods when called on local functions with same names [#520].
|
|
39
41
|
- (mcm1957) '[W438] .vscode/settings.json file missing "json.schemas" property' has been converted to suggestion [#516].
|
|
40
42
|
- (mcm1957) Severity of '[S191] admin dependency...' has been corrected [#510].
|
|
41
|
-
|
|
42
|
-
### 4.2.0-alpha.5 (2025-09-15)
|
|
43
43
|
- (copilot) Added io-package.json schema validation against official schema (W205, W207, W208) [#503].
|
|
44
44
|
- (copilot) Added check for deprecated adapter methods (createState/createChannel/createDevice/deleteState/deleteChannel/deleteDevice) (W533) [#182].
|
|
45
45
|
- (copilot) Added check for outdated lib/tools.js file usage (W532) [#432].
|
package/lib/M500_Code.js
CHANGED
|
@@ -613,12 +613,7 @@ async function checkCode(context) {
|
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
-
// Pattern 2:
|
|
617
|
-
if (/\badapter\s*=\s*utils\.Adapter\s*\(/i.test(line)) {
|
|
618
|
-
return true;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
// Pattern 3: extends Adapter (without utils prefix)
|
|
616
|
+
// Pattern 2: extends Adapter (without utils prefix)
|
|
622
617
|
if (/class\s+\w+\s+extends\s+Adapter/i.test(line) && i < lineIndex) {
|
|
623
618
|
// Similar brace counting logic as above
|
|
624
619
|
let braceCount = 0;
|
|
@@ -696,29 +691,46 @@ async function checkCode(context) {
|
|
|
696
691
|
continue;
|
|
697
692
|
}
|
|
698
693
|
|
|
699
|
-
// Check for this.methodName
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
694
|
+
// Check for this.methodName pattern
|
|
695
|
+
const thisPattern = new RegExp(`\\bthis\\.${method}\\s*\\(`, 'g');
|
|
696
|
+
// Check for adapter.methodName pattern
|
|
697
|
+
const adapterPattern = new RegExp(`\\badapter\\.${method}\\s*\\(`, 'g');
|
|
698
|
+
|
|
699
|
+
// Handle this.method() calls - should warn when inside adapter class context
|
|
700
|
+
if (thisPattern.test(line)) {
|
|
701
|
+
// Make sure this is not a private function definition
|
|
702
|
+
const functionDefPattern = new RegExp(
|
|
703
|
+
`(function\\s+${method}|${method}\\s*[=:]\\s*function|${method}\\s*\\([^)]*\\)\\s*{)`,
|
|
704
|
+
'i',
|
|
705
|
+
);
|
|
706
|
+
if (!functionDefPattern.test(line)) {
|
|
707
|
+
// Only warn if we're in an adapter class context
|
|
708
|
+
if (isInAdapterClassContext(lines, i)) {
|
|
709
|
+
context.warnings.push(
|
|
710
|
+
`[W533] method "${method}()" is deprecated and will be removed with future js-controller version. Please use "set/deleteObject()" instead.`,
|
|
711
|
+
);
|
|
712
|
+
reportedMethods.add(method);
|
|
713
|
+
break; // Only warn once per line
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// Handle adapter.method() calls - should warn when called outside of any class
|
|
719
|
+
if (adapterPattern.test(line)) {
|
|
720
|
+
// Make sure this is not a private function definition
|
|
721
|
+
const functionDefPattern = new RegExp(
|
|
722
|
+
`(function\\s+${method}|${method}\\s*[=:]\\s*function|${method}\\s*\\([^)]*\\)\\s*{)`,
|
|
723
|
+
'i',
|
|
724
|
+
);
|
|
725
|
+
if (!functionDefPattern.test(line)) {
|
|
726
|
+
// Warn if we're NOT in an adapter class context (outside any class)
|
|
727
|
+
if (!isInAdapterClassContext(lines, i)) {
|
|
728
|
+
context.warnings.push(
|
|
729
|
+
`[W533] method "${method}()" is deprecated and will be removed with future js-controller version. Please use "set/deleteObject()" instead.`,
|
|
730
|
+
);
|
|
731
|
+
reportedMethods.add(method);
|
|
732
|
+
break; // Only warn once per line
|
|
720
733
|
}
|
|
721
|
-
break; // Only warn once per line
|
|
722
734
|
}
|
|
723
735
|
}
|
|
724
736
|
}
|
package/lib/M800_Github.js
CHANGED
|
@@ -92,24 +92,25 @@ async function checkGithubRepo(context) {
|
|
|
92
92
|
|
|
93
93
|
const issues = await getAllIssues(context);
|
|
94
94
|
for (const issue of issues) {
|
|
95
|
-
if (issue.pull_request) {
|
|
96
|
-
|
|
97
|
-
}
|
|
95
|
+
// if (issue.pull_request) {
|
|
96
|
+
// continue;
|
|
97
|
+
// }
|
|
98
|
+
const type = issue.pull_request ? 'PR' : 'issue';
|
|
98
99
|
if (issuesToWatchAsError.includes(issue.title)) {
|
|
99
100
|
context.errors.push(
|
|
100
|
-
`[E804] Please process
|
|
101
|
+
`[E804] Please process ${type} [[#${issue.number}] "${issue.title}"](${context.githubUrlOriginal}/issues/${issue.number})`,
|
|
101
102
|
);
|
|
102
103
|
} else if (issuesToWatchAsWarning.includes(issue.title)) {
|
|
103
104
|
context.warnings.push(
|
|
104
|
-
`[W804] Please process
|
|
105
|
+
`[W804] Please process ${type} [[#${issue.number}] "${issue.title}"](${context.githubUrlOriginal}/issues/${issue.number})`,
|
|
105
106
|
);
|
|
106
107
|
} else if (issue.title.startsWith('URGENT:')) {
|
|
107
108
|
context.errors.push(
|
|
108
|
-
`[E804] Please process
|
|
109
|
+
`[E804] Please process ${type} [[#${issue.number}] "${issue.title}"](${context.githubUrlOriginal}/issues/${issue.number})`,
|
|
109
110
|
);
|
|
110
111
|
} else if (issue.title.startsWith('IMPORTANT:')) {
|
|
111
112
|
context.warnings.push(
|
|
112
|
-
`[W804] Please process
|
|
113
|
+
`[W804] Please process ${type} [[#${issue.number}] "${issue.title}"](${context.githubUrlOriginal}/issues/${issue.number})`,
|
|
113
114
|
);
|
|
114
115
|
}
|
|
115
116
|
}
|
package/package.json
CHANGED