@abaplint/core 2.93.43 → 2.93.45
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/pretty_printer/indent.js +2 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/abapdoc.js +12 -2
- package/build/src/rules/main_file_contents.js +25 -2
- package/build/src/rules/omit_preceding_zeros.js +13 -8
- package/build/src/rules/unnecessary_pragma.js +1 -0
- package/package.json +2 -2
|
@@ -75,6 +75,7 @@ class Indent {
|
|
|
75
75
|
|| type instanceof Statements.Initialization
|
|
76
76
|
|| type instanceof Statements.AtUserCommand
|
|
77
77
|
|| type instanceof Statements.TopOfPage
|
|
78
|
+
|| type instanceof Statements.Get
|
|
78
79
|
|| type instanceof Statements.EndOfSelection
|
|
79
80
|
|| type instanceof Statements.LoadOfProgram) {
|
|
80
81
|
indent = init;
|
|
@@ -156,6 +157,7 @@ class Indent {
|
|
|
156
157
|
statement.concatTokens().toUpperCase().includes("BEGIN OF BLOCK") ||
|
|
157
158
|
statement.concatTokens().toUpperCase().includes("BEGIN OF LINE")))
|
|
158
159
|
|| type instanceof Statements.StartOfSelection
|
|
160
|
+
|| type instanceof Statements.Get
|
|
159
161
|
|| type instanceof Statements.AtSelectionScreen
|
|
160
162
|
|| type instanceof Statements.AtLineSelection
|
|
161
163
|
|| type instanceof Statements.LoadOfProgram
|
package/build/src/registry.js
CHANGED
|
@@ -75,8 +75,8 @@ Plus class and interface definitions.`,
|
|
|
75
75
|
if (method.isRedefinition === true) {
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
if (!(
|
|
78
|
+
const previousRowText = this.getPreviousRow(rows, method.identifier.getStart());
|
|
79
|
+
if (!(previousRowText.substring(0, 2) === "\"!")) {
|
|
80
80
|
const message = "Missing ABAP Doc for method " + method.identifier.getToken().getStr();
|
|
81
81
|
const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
|
|
82
82
|
issues.push(issue);
|
|
@@ -84,6 +84,16 @@ Plus class and interface definitions.`,
|
|
|
84
84
|
}
|
|
85
85
|
return issues;
|
|
86
86
|
}
|
|
87
|
+
getPreviousRow(rows, pos) {
|
|
88
|
+
const previousRow = pos.getRow() - 2;
|
|
89
|
+
const text = rows[previousRow].trim().toUpperCase();
|
|
90
|
+
if (text === "METHODS" || text === "CLASS-METHODS") {
|
|
91
|
+
const previousRow = pos.getRow() - 3;
|
|
92
|
+
const text = rows[previousRow].trim().toUpperCase();
|
|
93
|
+
return text;
|
|
94
|
+
}
|
|
95
|
+
return text;
|
|
96
|
+
}
|
|
87
97
|
}
|
|
88
98
|
exports.Abapdoc = Abapdoc;
|
|
89
99
|
//# sourceMappingURL=abapdoc.js.map
|
|
@@ -22,7 +22,11 @@ class MainFileContents {
|
|
|
22
22
|
key: "main_file_contents",
|
|
23
23
|
title: "Main file contents",
|
|
24
24
|
shortDescription: `Checks related to report declarations.`,
|
|
25
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
25
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
26
|
+
|
|
27
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
28
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
29
|
+
`,
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
32
|
getDescription(details) {
|
|
@@ -72,7 +76,26 @@ class MainFileContents {
|
|
|
72
76
|
}
|
|
73
77
|
else if (name.getFirstToken().getStr().toUpperCase() !== obj.getName()) {
|
|
74
78
|
const token = name.getFirstToken();
|
|
75
|
-
const issue = issue_1.Issue.atToken(main, token, this.getDescription("REPORT or PROGRAM name
|
|
79
|
+
const issue = issue_1.Issue.atToken(main, token, this.getDescription("REPORT or PROGRAM name must match filename"), this.getMetadata().key, this.conf.severity);
|
|
80
|
+
return [issue];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (obj instanceof Objects.TypePool) {
|
|
84
|
+
let count = 0;
|
|
85
|
+
let first = main.getStatements()[count];
|
|
86
|
+
while (first !== undefined && first.get() instanceof _statement_1.Comment) {
|
|
87
|
+
count = count + 1;
|
|
88
|
+
first = main.getStatements()[count];
|
|
89
|
+
}
|
|
90
|
+
if (first === undefined || !(first.get() instanceof Statements.TypePool)) {
|
|
91
|
+
const position = new position_1.Position(1, 1);
|
|
92
|
+
const issue = issue_1.Issue.atPosition(main, position, this.getDescription("Type pool must begin with TYPE-POOL"), this.getMetadata().key, this.conf.severity);
|
|
93
|
+
return [issue];
|
|
94
|
+
}
|
|
95
|
+
const name = first.getChildren()[3];
|
|
96
|
+
if (name.getFirstToken().getStr().toUpperCase() !== obj.getName()) {
|
|
97
|
+
const token = name.getFirstToken();
|
|
98
|
+
const issue = issue_1.Issue.atToken(main, token, this.getDescription("TYPE-POOL name must match filename"), this.getMetadata().key, this.conf.severity);
|
|
76
99
|
return [issue];
|
|
77
100
|
}
|
|
78
101
|
}
|
|
@@ -6,6 +6,7 @@ const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
|
6
6
|
const issue_1 = require("../issue");
|
|
7
7
|
const Expressions = require("../abap/2_statements/expressions");
|
|
8
8
|
const _irule_1 = require("./_irule");
|
|
9
|
+
const statements_1 = require("../abap/2_statements/statements");
|
|
9
10
|
class OmitPrecedingZerosConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
11
|
}
|
|
11
12
|
exports.OmitPrecedingZerosConf = OmitPrecedingZerosConf;
|
|
@@ -31,15 +32,19 @@ class OmitPrecedingZeros extends _abap_rule_1.ABAPRule {
|
|
|
31
32
|
this.conf = conf;
|
|
32
33
|
}
|
|
33
34
|
runParsed(file) {
|
|
34
|
-
var _a;
|
|
35
35
|
const issues = [];
|
|
36
|
-
for (const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
for (const s of file.getStatements()) {
|
|
37
|
+
for (const i of s.findAllExpressions(Expressions.Integer)) {
|
|
38
|
+
const token = i.getLastToken();
|
|
39
|
+
const str = token.getStr();
|
|
40
|
+
if (str.length > 1 && str.startsWith("0")) {
|
|
41
|
+
if (s.get() instanceof statements_1.CallScreen || s.get() instanceof statements_1.SetScreen) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const message = "Omit preceding zeros";
|
|
45
|
+
const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.getConfig().severity);
|
|
46
|
+
issues.push(issue);
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
return issues;
|
|
@@ -117,6 +117,7 @@ ENDIF.`,
|
|
|
117
117
|
&& !(statement.get() instanceof Statements.Data)
|
|
118
118
|
&& !(statement.get() instanceof Statements.DataEnd)
|
|
119
119
|
&& !(statement.get() instanceof Statements.Type)
|
|
120
|
+
&& !(statement.get() instanceof Statements.Form)
|
|
120
121
|
&& !(statement.get() instanceof Statements.TypeEnd)
|
|
121
122
|
&& !(statement.get() instanceof Statements.Constant)
|
|
122
123
|
&& !(statement.get() instanceof Statements.ConstantEnd)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.93.
|
|
3
|
+
"version": "2.93.45",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://abaplint.org",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@microsoft/api-extractor": "^7.33.
|
|
49
|
+
"@microsoft/api-extractor": "^7.33.4",
|
|
50
50
|
"@types/chai": "^4.3.3",
|
|
51
51
|
"@types/mocha": "^10.0.0",
|
|
52
52
|
"@types/node": "^18.11.0",
|