@abaplint/core 2.113.240 → 2.113.241
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
|
@@ -6,6 +6,7 @@ const _abap_object_1 = require("../objects/_abap_object");
|
|
|
6
6
|
const include_graph_1 = require("../utils/include_graph");
|
|
7
7
|
const _irule_1 = require("./_irule");
|
|
8
8
|
const objects_1 = require("../objects");
|
|
9
|
+
const severity_1 = require("../severity");
|
|
9
10
|
class CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
11
|
}
|
|
11
12
|
exports.CheckIncludeConf = CheckIncludeConf;
|
|
@@ -34,7 +35,7 @@ class CheckInclude {
|
|
|
34
35
|
}
|
|
35
36
|
initialize(reg) {
|
|
36
37
|
this.reg = reg;
|
|
37
|
-
this.graph = new include_graph_1.IncludeGraph(this.reg);
|
|
38
|
+
this.graph = new include_graph_1.IncludeGraph(this.reg, this.getConfig().severity || severity_1.Severity.Error);
|
|
38
39
|
return this;
|
|
39
40
|
}
|
|
40
41
|
run(obj) {
|
|
@@ -60,10 +60,11 @@ class Graph {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
class IncludeGraph {
|
|
63
|
-
constructor(reg) {
|
|
63
|
+
constructor(reg, severity = severity_1.Severity.Error) {
|
|
64
64
|
this.reg = reg;
|
|
65
65
|
this.issues = [];
|
|
66
66
|
this.graph = new Graph();
|
|
67
|
+
this.severity = severity;
|
|
67
68
|
this.build();
|
|
68
69
|
}
|
|
69
70
|
listMainForInclude(filename) {
|
|
@@ -93,7 +94,7 @@ class IncludeGraph {
|
|
|
93
94
|
if (f === undefined) {
|
|
94
95
|
throw new Error("findUnusedIncludes internal error");
|
|
95
96
|
}
|
|
96
|
-
const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key,
|
|
97
|
+
const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, this.severity);
|
|
97
98
|
ret.push(issue);
|
|
98
99
|
}
|
|
99
100
|
return ret;
|
|
@@ -121,12 +122,12 @@ class IncludeGraph {
|
|
|
121
122
|
if (found === undefined) {
|
|
122
123
|
const ifFound = s.concatTokens().toUpperCase().includes("IF FOUND");
|
|
123
124
|
if (ifFound === false) {
|
|
124
|
-
const issue = issue_1.Issue.atStatement(f, s, "Include " + name + " not found", new check_include_1.CheckInclude().getMetadata().key,
|
|
125
|
+
const issue = issue_1.Issue.atStatement(f, s, "Include " + name + " not found", new check_include_1.CheckInclude().getMetadata().key, this.severity);
|
|
125
126
|
this.issues.push(issue);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
else if (found.include === false) {
|
|
129
|
-
const issue = issue_1.Issue.atStatement(f, s, "Not possible to INCLUDE a main program, " + name, new check_include_1.CheckInclude().getMetadata().key,
|
|
130
|
+
const issue = issue_1.Issue.atStatement(f, s, "Not possible to INCLUDE a main program, " + name, new check_include_1.CheckInclude().getMetadata().key, this.severity);
|
|
130
131
|
this.issues.push(issue);
|
|
131
132
|
}
|
|
132
133
|
else {
|