@abaplint/cli 2.113.201 → 2.113.203
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/cli.js +93 -36
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -1250,19 +1250,17 @@ const virtual_position_1 = __webpack_require__(/*! ../../virtual_position */ "./
|
|
|
1250
1250
|
const tokens_1 = __webpack_require__(/*! ./tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
1251
1251
|
const lexer_buffer_1 = __webpack_require__(/*! ./lexer_buffer */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_buffer.js");
|
|
1252
1252
|
const lexer_stream_1 = __webpack_require__(/*! ./lexer_stream */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer_stream.js");
|
|
1253
|
+
const ModeNormal = 1;
|
|
1254
|
+
const ModePing = 2;
|
|
1255
|
+
const ModeStr = 3;
|
|
1256
|
+
const ModeTemplate = 4;
|
|
1257
|
+
const ModeComment = 5;
|
|
1258
|
+
const ModePragma = 6;
|
|
1253
1259
|
class Lexer {
|
|
1254
|
-
constructor() {
|
|
1255
|
-
this.ModeNormal = 1;
|
|
1256
|
-
this.ModePing = 2;
|
|
1257
|
-
this.ModeStr = 3;
|
|
1258
|
-
this.ModeTemplate = 4;
|
|
1259
|
-
this.ModeComment = 5;
|
|
1260
|
-
this.ModePragma = 6;
|
|
1261
|
-
}
|
|
1262
1260
|
run(file, virtual) {
|
|
1263
1261
|
this.virtual = virtual;
|
|
1264
1262
|
this.tokens = [];
|
|
1265
|
-
this.m =
|
|
1263
|
+
this.m = ModeNormal;
|
|
1266
1264
|
this.process(file.getRaw());
|
|
1267
1265
|
return { file, tokens: this.tokens };
|
|
1268
1266
|
}
|
|
@@ -1288,13 +1286,13 @@ class Lexer {
|
|
|
1288
1286
|
pos = new virtual_position_1.VirtualPosition(this.virtual, pos.getRow(), pos.getCol());
|
|
1289
1287
|
}
|
|
1290
1288
|
let tok = undefined;
|
|
1291
|
-
if (this.m ===
|
|
1289
|
+
if (this.m === ModeComment) {
|
|
1292
1290
|
tok = new tokens_1.Comment(pos, s);
|
|
1293
1291
|
}
|
|
1294
|
-
else if (this.m ===
|
|
1292
|
+
else if (this.m === ModePing || this.m === ModeStr) {
|
|
1295
1293
|
tok = new tokens_1.StringToken(pos, s);
|
|
1296
1294
|
}
|
|
1297
|
-
else if (this.m ===
|
|
1295
|
+
else if (this.m === ModeTemplate) {
|
|
1298
1296
|
const first = s.charAt(0);
|
|
1299
1297
|
const last = s.charAt(s.length - 1);
|
|
1300
1298
|
if (first === "|" && last === "|") {
|
|
@@ -1487,35 +1485,35 @@ class Lexer {
|
|
|
1487
1485
|
const buf = this.buffer.add(current);
|
|
1488
1486
|
const ahead = this.stream.nextChar();
|
|
1489
1487
|
const aahead = this.stream.nextNextChar();
|
|
1490
|
-
if (this.m ===
|
|
1488
|
+
if (this.m === ModeNormal) {
|
|
1491
1489
|
if (splits[ahead]) {
|
|
1492
1490
|
this.add();
|
|
1493
1491
|
}
|
|
1494
1492
|
else if (ahead === "'") {
|
|
1495
1493
|
// start string
|
|
1496
1494
|
this.add();
|
|
1497
|
-
this.m =
|
|
1495
|
+
this.m = ModeStr;
|
|
1498
1496
|
}
|
|
1499
1497
|
else if (ahead === "|" || ahead === "}") {
|
|
1500
1498
|
// start template
|
|
1501
1499
|
this.add();
|
|
1502
|
-
this.m =
|
|
1500
|
+
this.m = ModeTemplate;
|
|
1503
1501
|
}
|
|
1504
1502
|
else if (ahead === "`") {
|
|
1505
1503
|
// start ping
|
|
1506
1504
|
this.add();
|
|
1507
|
-
this.m =
|
|
1505
|
+
this.m = ModePing;
|
|
1508
1506
|
}
|
|
1509
1507
|
else if (aahead === "##") {
|
|
1510
1508
|
// start pragma
|
|
1511
1509
|
this.add();
|
|
1512
|
-
this.m =
|
|
1510
|
+
this.m = ModePragma;
|
|
1513
1511
|
}
|
|
1514
1512
|
else if (ahead === "\""
|
|
1515
1513
|
|| (ahead === "*" && current === "\n")) {
|
|
1516
1514
|
// start comment
|
|
1517
1515
|
this.add();
|
|
1518
|
-
this.m =
|
|
1516
|
+
this.m = ModeComment;
|
|
1519
1517
|
}
|
|
1520
1518
|
else if (ahead === "@" && buf.trim().length === 0) {
|
|
1521
1519
|
this.add();
|
|
@@ -1536,12 +1534,12 @@ class Lexer {
|
|
|
1536
1534
|
this.add();
|
|
1537
1535
|
}
|
|
1538
1536
|
}
|
|
1539
|
-
else if (this.m ===
|
|
1537
|
+
else if (this.m === ModePragma && (ahead === "," || ahead === ":" || ahead === "." || ahead === " " || ahead === "\n")) {
|
|
1540
1538
|
// end of pragma
|
|
1541
1539
|
this.add();
|
|
1542
|
-
this.m =
|
|
1540
|
+
this.m = ModeNormal;
|
|
1543
1541
|
}
|
|
1544
|
-
else if (this.m ===
|
|
1542
|
+
else if (this.m === ModePing
|
|
1545
1543
|
&& buf.length > 1
|
|
1546
1544
|
&& current === "`"
|
|
1547
1545
|
&& aahead !== "``"
|
|
@@ -1550,26 +1548,26 @@ class Lexer {
|
|
|
1550
1548
|
// end of ping
|
|
1551
1549
|
this.add();
|
|
1552
1550
|
if (ahead === `"`) {
|
|
1553
|
-
this.m =
|
|
1551
|
+
this.m = ModeComment;
|
|
1554
1552
|
}
|
|
1555
1553
|
else {
|
|
1556
|
-
this.m =
|
|
1554
|
+
this.m = ModeNormal;
|
|
1557
1555
|
}
|
|
1558
1556
|
}
|
|
1559
|
-
else if (this.m ===
|
|
1557
|
+
else if (this.m === ModeTemplate
|
|
1560
1558
|
&& buf.length > 1
|
|
1561
1559
|
&& (current === "|" || current === "{")
|
|
1562
1560
|
&& (this.stream.prevChar() !== "\\" || this.stream.prevPrevChar() === "\\\\")) {
|
|
1563
1561
|
// end of template
|
|
1564
1562
|
this.add();
|
|
1565
|
-
this.m =
|
|
1563
|
+
this.m = ModeNormal;
|
|
1566
1564
|
}
|
|
1567
|
-
else if (this.m ===
|
|
1565
|
+
else if (this.m === ModeTemplate
|
|
1568
1566
|
&& ahead === "}"
|
|
1569
1567
|
&& current !== "\\") {
|
|
1570
1568
|
this.add();
|
|
1571
1569
|
}
|
|
1572
|
-
else if (this.m ===
|
|
1570
|
+
else if (this.m === ModeStr
|
|
1573
1571
|
&& current === "'"
|
|
1574
1572
|
&& buf.length > 1
|
|
1575
1573
|
&& aahead !== "''"
|
|
@@ -1578,17 +1576,17 @@ class Lexer {
|
|
|
1578
1576
|
// end of string
|
|
1579
1577
|
this.add();
|
|
1580
1578
|
if (ahead === "\"") {
|
|
1581
|
-
this.m =
|
|
1579
|
+
this.m = ModeComment;
|
|
1582
1580
|
}
|
|
1583
1581
|
else {
|
|
1584
|
-
this.m =
|
|
1582
|
+
this.m = ModeNormal;
|
|
1585
1583
|
}
|
|
1586
1584
|
}
|
|
1587
|
-
else if (ahead === "\n" && this.m !==
|
|
1585
|
+
else if (ahead === "\n" && this.m !== ModeTemplate) {
|
|
1588
1586
|
this.add();
|
|
1589
|
-
this.m =
|
|
1587
|
+
this.m = ModeNormal;
|
|
1590
1588
|
}
|
|
1591
|
-
else if (this.m ===
|
|
1589
|
+
else if (this.m === ModeTemplate && current === "\n") {
|
|
1592
1590
|
this.add();
|
|
1593
1591
|
}
|
|
1594
1592
|
if (!this.stream.advance()) {
|
|
@@ -53392,7 +53390,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
53392
53390
|
}
|
|
53393
53391
|
getAllowedNaming() {
|
|
53394
53392
|
let length = 30;
|
|
53395
|
-
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3})\w+$/;
|
|
53393
|
+
const regex = /^((\/[A-Z_\d]{3,8}\/)|[a-zA-Z0-9]{3}|CI_)\w+$/;
|
|
53396
53394
|
if (this.getTableCategory() === TableCategory.Transparent) {
|
|
53397
53395
|
length = 16;
|
|
53398
53396
|
}
|
|
@@ -55001,7 +54999,7 @@ class Registry {
|
|
|
55001
54999
|
}
|
|
55002
55000
|
static abaplintVersion() {
|
|
55003
55001
|
// magic, see build script "version.sh"
|
|
55004
|
-
return "2.113.
|
|
55002
|
+
return "2.113.203";
|
|
55005
55003
|
}
|
|
55006
55004
|
getDDICReferences() {
|
|
55007
55005
|
return this.ddicReferences;
|
|
@@ -57705,6 +57703,7 @@ class CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
57705
57703
|
super(...arguments);
|
|
57706
57704
|
/** Allows the use of end-of-line comments. */
|
|
57707
57705
|
this.allowEndOfLine = false;
|
|
57706
|
+
this.maxIssuesPerFile = 10;
|
|
57708
57707
|
}
|
|
57709
57708
|
}
|
|
57710
57709
|
exports.CheckCommentsConf = CheckCommentsConf;
|
|
@@ -57750,6 +57749,10 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comment
|
|
|
57750
57749
|
if (this.conf.allowEndOfLine === true) {
|
|
57751
57750
|
return [];
|
|
57752
57751
|
}
|
|
57752
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
57753
|
+
if (max === undefined || max < 1) {
|
|
57754
|
+
max = 10;
|
|
57755
|
+
}
|
|
57753
57756
|
const commentRows = [];
|
|
57754
57757
|
for (let i = 0; i < rows.length; i++) {
|
|
57755
57758
|
const row = rows[i];
|
|
@@ -57766,6 +57769,9 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comment
|
|
|
57766
57769
|
continue;
|
|
57767
57770
|
}
|
|
57768
57771
|
issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));
|
|
57772
|
+
if (issues.length >= max) {
|
|
57773
|
+
break;
|
|
57774
|
+
}
|
|
57769
57775
|
}
|
|
57770
57776
|
}
|
|
57771
57777
|
return issues;
|
|
@@ -66026,6 +66032,7 @@ class IndentationConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
66026
66032
|
this.globalClassSkipFirst = false;
|
|
66027
66033
|
this.ignoreGlobalClassDefinition = false;
|
|
66028
66034
|
this.ignoreGlobalInterface = false;
|
|
66035
|
+
this.maxIssuesPerFile = 10;
|
|
66029
66036
|
}
|
|
66030
66037
|
}
|
|
66031
66038
|
exports.IndentationConf = IndentationConf;
|
|
@@ -66068,7 +66075,10 @@ ENDCLASS.`,
|
|
|
66068
66075
|
}
|
|
66069
66076
|
runParsed(file, obj) {
|
|
66070
66077
|
var _a, _b;
|
|
66071
|
-
|
|
66078
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
66079
|
+
if (max === undefined || max < 1) {
|
|
66080
|
+
max = 10;
|
|
66081
|
+
}
|
|
66072
66082
|
let skip = false;
|
|
66073
66083
|
if (file.getStructure() === undefined) {
|
|
66074
66084
|
return []; // syntax error in file
|
|
@@ -66140,7 +66150,7 @@ ENDCLASS.`,
|
|
|
66140
66150
|
const message = "Indentation problem, expected " + expected + " spaces";
|
|
66141
66151
|
const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity, fix);
|
|
66142
66152
|
ret.push(issue);
|
|
66143
|
-
if (ret.length >=
|
|
66153
|
+
if (ret.length >= max) {
|
|
66144
66154
|
break;
|
|
66145
66155
|
}
|
|
66146
66156
|
}
|
|
@@ -66810,6 +66820,7 @@ class KeywordCaseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
66810
66820
|
this.ignoreGlobalClassBoundaries = false;
|
|
66811
66821
|
/** A list of keywords to be ignored */
|
|
66812
66822
|
this.ignoreKeywords = [];
|
|
66823
|
+
this.maxIssuesPerFile = 10;
|
|
66813
66824
|
}
|
|
66814
66825
|
}
|
|
66815
66826
|
exports.KeywordCaseConf = KeywordCaseConf;
|
|
@@ -66920,6 +66931,10 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
66920
66931
|
return [];
|
|
66921
66932
|
}
|
|
66922
66933
|
}
|
|
66934
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
66935
|
+
if (max === undefined || max < 1) {
|
|
66936
|
+
max = 10;
|
|
66937
|
+
}
|
|
66923
66938
|
const skip = new Skip(this.getConfig());
|
|
66924
66939
|
let prev = undefined;
|
|
66925
66940
|
for (const statement of file.getStatements()) {
|
|
@@ -66942,6 +66957,9 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
66942
66957
|
}
|
|
66943
66958
|
prev = result[0].token;
|
|
66944
66959
|
}
|
|
66960
|
+
if (issues.length >= max) {
|
|
66961
|
+
break;
|
|
66962
|
+
}
|
|
66945
66963
|
}
|
|
66946
66964
|
return issues;
|
|
66947
66965
|
}
|
|
@@ -67209,6 +67227,7 @@ class LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
67209
67227
|
super(...arguments);
|
|
67210
67228
|
/** Maximum line length in characters, trailing whitespace ignored */
|
|
67211
67229
|
this.length = 120;
|
|
67230
|
+
this.maxIssuesPerFile = 10;
|
|
67212
67231
|
}
|
|
67213
67232
|
}
|
|
67214
67233
|
exports.LineLengthConf = LineLengthConf;
|
|
@@ -67237,6 +67256,10 @@ https://docs.abapopenchecks.org/checks/04/`,
|
|
|
67237
67256
|
const issues = [];
|
|
67238
67257
|
// maximum line length in abap files
|
|
67239
67258
|
const maxLineLength = 255;
|
|
67259
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
67260
|
+
if (max === undefined || max < 1) {
|
|
67261
|
+
max = 10;
|
|
67262
|
+
}
|
|
67240
67263
|
const array = file.getRawRows();
|
|
67241
67264
|
for (let rowIndex = 0; rowIndex < array.length; rowIndex++) {
|
|
67242
67265
|
const row = array[rowIndex].replace("\r", "");
|
|
@@ -67248,6 +67271,9 @@ https://docs.abapopenchecks.org/checks/04/`,
|
|
|
67248
67271
|
const message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;
|
|
67249
67272
|
issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));
|
|
67250
67273
|
}
|
|
67274
|
+
if (issues.length >= max) {
|
|
67275
|
+
break;
|
|
67276
|
+
}
|
|
67251
67277
|
}
|
|
67252
67278
|
return issues;
|
|
67253
67279
|
}
|
|
@@ -69692,6 +69718,7 @@ class NoPrefixesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
69692
69718
|
/** importing, exporting, returning and changing parameters, case insensitive regex */
|
|
69693
69719
|
this.methodParameters = "^[ICER].?_";
|
|
69694
69720
|
this.allowIsPrefixBoolean = true;
|
|
69721
|
+
this.maxIssuesPerFile = 10;
|
|
69695
69722
|
// todo, public localClass: string = "";
|
|
69696
69723
|
// todo, public localInterface: string = "";
|
|
69697
69724
|
// todo, public functionModuleParameters: string = "";
|
|
@@ -69738,21 +69765,40 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodi
|
|
|
69738
69765
|
// syntax error, skip
|
|
69739
69766
|
return [];
|
|
69740
69767
|
}
|
|
69768
|
+
let max = config.maxIssuesPerFile;
|
|
69769
|
+
if (max === undefined || max < 1) {
|
|
69770
|
+
max = 10;
|
|
69771
|
+
}
|
|
69741
69772
|
if (config.data !== undefined && config.data !== "") {
|
|
69742
69773
|
ret.push(...this.checkData(structure, new RegExp(config.data, "i"), file));
|
|
69743
69774
|
}
|
|
69775
|
+
if (ret.length >= max) {
|
|
69776
|
+
return ret;
|
|
69777
|
+
}
|
|
69744
69778
|
if (config.statics !== undefined && config.statics !== "") {
|
|
69745
69779
|
ret.push(...this.checkStatics(structure, new RegExp(config.statics, "i"), file));
|
|
69746
69780
|
}
|
|
69781
|
+
if (ret.length >= max) {
|
|
69782
|
+
return ret;
|
|
69783
|
+
}
|
|
69747
69784
|
if (config.fieldSymbols !== undefined && config.fieldSymbols !== "") {
|
|
69748
69785
|
ret.push(...this.checkFieldSymbols(structure, new RegExp(config.fieldSymbols, "i"), file));
|
|
69749
69786
|
}
|
|
69787
|
+
if (ret.length >= max) {
|
|
69788
|
+
return ret;
|
|
69789
|
+
}
|
|
69750
69790
|
if (config.constants !== undefined && config.constants !== "") {
|
|
69751
69791
|
ret.push(...this.checkConstants(structure, new RegExp(config.constants, "i"), file));
|
|
69752
69792
|
}
|
|
69793
|
+
if (ret.length >= max) {
|
|
69794
|
+
return ret;
|
|
69795
|
+
}
|
|
69753
69796
|
if (config.types !== undefined && config.types !== "") {
|
|
69754
69797
|
ret.push(...this.checkTypes(structure, new RegExp(config.types, "i"), file));
|
|
69755
69798
|
}
|
|
69799
|
+
if (ret.length >= max) {
|
|
69800
|
+
return ret;
|
|
69801
|
+
}
|
|
69756
69802
|
if (config.methodParameters !== undefined && config.methodParameters !== "") {
|
|
69757
69803
|
ret.push(...this.checkMethodParameters(structure, new RegExp(config.methodParameters, "i"), file));
|
|
69758
69804
|
}
|
|
@@ -75678,6 +75724,10 @@ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/c
|
|
|
75678
75724
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
75679
75725
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
75680
75726
|
class UnnecessaryChainingConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
75727
|
+
constructor() {
|
|
75728
|
+
super(...arguments);
|
|
75729
|
+
this.maxIssuesPerFile = 10;
|
|
75730
|
+
}
|
|
75681
75731
|
}
|
|
75682
75732
|
exports.UnnecessaryChainingConf = UnnecessaryChainingConf;
|
|
75683
75733
|
class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
@@ -75704,6 +75754,10 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
75704
75754
|
}
|
|
75705
75755
|
runParsed(file) {
|
|
75706
75756
|
const issues = [];
|
|
75757
|
+
let max = this.getConfig().maxIssuesPerFile;
|
|
75758
|
+
if (max === undefined || max < 1) {
|
|
75759
|
+
max = 10;
|
|
75760
|
+
}
|
|
75707
75761
|
const statements = file.getStatements();
|
|
75708
75762
|
for (let i = 0; i < statements.length; i++) {
|
|
75709
75763
|
const colon = statements[i].getColon();
|
|
@@ -75734,6 +75788,9 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
75734
75788
|
const message = "Unnecessary chaining";
|
|
75735
75789
|
const issue = issue_1.Issue.atToken(file, colon, message, this.getMetadata().key, this.conf.severity, fix);
|
|
75736
75790
|
issues.push(issue);
|
|
75791
|
+
if (issues.length >= max) {
|
|
75792
|
+
break;
|
|
75793
|
+
}
|
|
75737
75794
|
}
|
|
75738
75795
|
return issues;
|
|
75739
75796
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.203",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.113.
|
|
41
|
+
"@abaplint/core": "^2.113.203",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|