@abaplint/core 2.97.2 → 2.97.3
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
|
@@ -8,6 +8,7 @@ const _abap_rule_1 = require("./_abap_rule");
|
|
|
8
8
|
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
9
9
|
const version_1 = require("../version");
|
|
10
10
|
const _irule_1 = require("./_irule");
|
|
11
|
+
const edit_helper_1 = require("../edit_helper");
|
|
11
12
|
class StrictSQLConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
12
13
|
}
|
|
13
14
|
exports.StrictSQLConf = StrictSQLConf;
|
|
@@ -25,8 +26,10 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
25
26
|
|
|
26
27
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
27
28
|
|
|
28
|
-
Also see separate rule sql_escape_host_variables
|
|
29
|
-
|
|
29
|
+
Also see separate rule sql_escape_host_variables
|
|
30
|
+
|
|
31
|
+
Activates from v750 and up`,
|
|
32
|
+
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix],
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
getConfig() {
|
|
@@ -41,7 +44,7 @@ Also see separate rule sql_escape_host_variables`,
|
|
|
41
44
|
if (type === "INTF" || type === "TYPE") {
|
|
42
45
|
return [];
|
|
43
46
|
}
|
|
44
|
-
if (this.reg.getConfig().getVersion() < version_1.Version.
|
|
47
|
+
if (this.reg.getConfig().getVersion() < version_1.Version.v750
|
|
45
48
|
&& this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {
|
|
46
49
|
return [];
|
|
47
50
|
}
|
|
@@ -55,11 +58,15 @@ Also see separate rule sql_escape_host_variables`,
|
|
|
55
58
|
if (into === undefined || where === undefined) {
|
|
56
59
|
continue;
|
|
57
60
|
}
|
|
58
|
-
if (where.getFirstToken().getStart().isBefore(into.getFirstToken().getStart())) {
|
|
61
|
+
else if (where.getFirstToken().getStart().isBefore(into.getFirstToken().getStart())) {
|
|
59
62
|
continue;
|
|
60
63
|
}
|
|
64
|
+
const fix1 = edit_helper_1.EditHelper.deleteRange(file, into.getFirstToken().getStart(), into.getLastToken().getEnd());
|
|
65
|
+
const whereLast = where.getLastToken();
|
|
66
|
+
const fix2 = edit_helper_1.EditHelper.insertAt(file, whereLast.getEnd(), " " + into.concatTokens());
|
|
67
|
+
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
61
68
|
const message = "INTO/APPENDING must be last in strict SQL";
|
|
62
|
-
const issue = issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
|
|
69
|
+
const issue = issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);
|
|
63
70
|
issues.push(issue);
|
|
64
71
|
break;
|
|
65
72
|
}
|