@abaplint/core 2.102.0 → 2.102.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/build/src/registry.js
CHANGED
|
@@ -25,6 +25,12 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
25
25
|
badExample: `FORM hello1.
|
|
26
26
|
WRITE 'world'.
|
|
27
27
|
RETURN.
|
|
28
|
+
ENDFORM.
|
|
29
|
+
|
|
30
|
+
FORM foo.
|
|
31
|
+
IF 1 = 2.
|
|
32
|
+
RETURN.
|
|
33
|
+
ENDIF.
|
|
28
34
|
ENDFORM.`,
|
|
29
35
|
goodExample: `FORM hello2.
|
|
30
36
|
WRITE 'world'.
|
|
@@ -57,11 +63,11 @@ ENDFORM.`,
|
|
|
57
63
|
const fix = edit_helper_1.EditHelper.deleteStatement(file, prev);
|
|
58
64
|
issues.push(issue_1.Issue.atStatement(file, prev, message, this.getMetadata().key, this.getConfig().severity, fix));
|
|
59
65
|
}
|
|
66
|
+
// note: ENDTRY is not checked, it will usually just make it an empty catch handler, which is also bad
|
|
60
67
|
const prevprev = statements[i - 2];
|
|
61
68
|
if (prev && prevprev
|
|
62
69
|
&& prevprev.get() instanceof Statements.Return
|
|
63
|
-
&&
|
|
64
|
-
|| prev.get() instanceof Statements.EndTry)) {
|
|
70
|
+
&& prev.get() instanceof Statements.EndIf) {
|
|
65
71
|
const fix = edit_helper_1.EditHelper.deleteStatement(file, prevprev);
|
|
66
72
|
issues.push(issue_1.Issue.atStatement(file, prevprev, message, this.getMetadata().key, this.getConfig().severity, fix));
|
|
67
73
|
}
|