@abaplint/cli 2.102.41 → 2.102.43
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 +41 -16
- package/package.json +4 -4
package/build/cli.js
CHANGED
|
@@ -36801,7 +36801,7 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
36801
36801
|
this.exceptions.push(name);
|
|
36802
36802
|
}
|
|
36803
36803
|
this.visibility = visibility;
|
|
36804
|
-
this.parameters = new method_parameters_1.MethodParameters(node, this.filename, scope);
|
|
36804
|
+
this.parameters = new method_parameters_1.MethodParameters(node, this.filename, scope, this.abstract);
|
|
36805
36805
|
}
|
|
36806
36806
|
getVisibility() {
|
|
36807
36807
|
return this.visibility;
|
|
@@ -36959,7 +36959,7 @@ const _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ "./node
|
|
|
36959
36959
|
// this.exceptions = [];
|
|
36960
36960
|
// also consider RAISING vs EXCEPTIONS
|
|
36961
36961
|
class MethodParameters {
|
|
36962
|
-
constructor(node, filename, scope) {
|
|
36962
|
+
constructor(node, filename, scope, abstractMethod) {
|
|
36963
36963
|
if (!(node.get() instanceof method_def_1.MethodDef)) {
|
|
36964
36964
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
36965
36965
|
}
|
|
@@ -36975,7 +36975,7 @@ class MethodParameters {
|
|
|
36975
36975
|
// need the scope for LIKE typing inside method parameters
|
|
36976
36976
|
const parentName = scope.getName();
|
|
36977
36977
|
scope.push(_scope_type_1.ScopeType.MethodDefinition, "method definition", node.getStart(), filename);
|
|
36978
|
-
this.parse(node, scope, filename, parentName);
|
|
36978
|
+
this.parse(node, scope, filename, parentName, abstractMethod);
|
|
36979
36979
|
scope.pop(node.getEnd());
|
|
36980
36980
|
}
|
|
36981
36981
|
getFilename() {
|
|
@@ -37051,7 +37051,7 @@ class MethodParameters {
|
|
|
37051
37051
|
return this.defaults[parameter.toUpperCase()];
|
|
37052
37052
|
}
|
|
37053
37053
|
///////////////////
|
|
37054
|
-
parse(node, scope, filename, parentName) {
|
|
37054
|
+
parse(node, scope, filename, parentName, abstractMethod) {
|
|
37055
37055
|
var _a, _b;
|
|
37056
37056
|
const handler = node.findFirstExpression(Expressions.EventHandler);
|
|
37057
37057
|
if (handler) {
|
|
@@ -37091,7 +37091,7 @@ class MethodParameters {
|
|
|
37091
37091
|
}
|
|
37092
37092
|
const importing = node.findFirstExpression(Expressions.MethodDefImporting);
|
|
37093
37093
|
if (importing) {
|
|
37094
|
-
this.add(this.importing, importing, scope, ["importing" /* IdentifierMeta.MethodImporting */]);
|
|
37094
|
+
this.add(this.importing, importing, scope, ["importing" /* IdentifierMeta.MethodImporting */], abstractMethod);
|
|
37095
37095
|
if (importing.concatTokens().toUpperCase().includes(" PREFERRED PARAMETER")) {
|
|
37096
37096
|
this.preferred = importing.getLastToken().getStr().toUpperCase();
|
|
37097
37097
|
if (this.preferred.startsWith("!")) {
|
|
@@ -37101,11 +37101,11 @@ class MethodParameters {
|
|
|
37101
37101
|
}
|
|
37102
37102
|
const exporting = node.findFirstExpression(Expressions.MethodDefExporting);
|
|
37103
37103
|
if (exporting) {
|
|
37104
|
-
this.add(this.exporting, exporting, scope, ["exporting" /* IdentifierMeta.MethodExporting */]);
|
|
37104
|
+
this.add(this.exporting, exporting, scope, ["exporting" /* IdentifierMeta.MethodExporting */], abstractMethod);
|
|
37105
37105
|
}
|
|
37106
37106
|
const changing = node.findFirstExpression(Expressions.MethodDefChanging);
|
|
37107
37107
|
if (changing) {
|
|
37108
|
-
this.add(this.changing, changing, scope, ["changing" /* IdentifierMeta.MethodChanging */]);
|
|
37108
|
+
this.add(this.changing, changing, scope, ["changing" /* IdentifierMeta.MethodChanging */], abstractMethod);
|
|
37109
37109
|
}
|
|
37110
37110
|
const returning = node.findFirstExpression(Expressions.MethodDefReturning);
|
|
37111
37111
|
if (returning) {
|
|
@@ -37151,7 +37151,7 @@ class MethodParameters {
|
|
|
37151
37151
|
this.importing.push(...tempImporting);
|
|
37152
37152
|
}
|
|
37153
37153
|
}
|
|
37154
|
-
add(target, source, scope, meta) {
|
|
37154
|
+
add(target, source, scope, meta, abstractMethod) {
|
|
37155
37155
|
var _a;
|
|
37156
37156
|
for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
|
|
37157
37157
|
const p = opt.findDirectExpression(Expressions.MethodParam);
|
|
@@ -37165,6 +37165,9 @@ class MethodParameters {
|
|
|
37165
37165
|
else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
|
|
37166
37166
|
extraMeta.push("read_only" /* IdentifierMeta.ReadOnly */);
|
|
37167
37167
|
}
|
|
37168
|
+
if (abstractMethod === true) {
|
|
37169
|
+
extraMeta.push("abstract" /* IdentifierMeta.Abstract */);
|
|
37170
|
+
}
|
|
37168
37171
|
const id = new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]);
|
|
37169
37172
|
scope.addIdentifier(id);
|
|
37170
37173
|
target.push(id);
|
|
@@ -48893,7 +48896,7 @@ class Registry {
|
|
|
48893
48896
|
}
|
|
48894
48897
|
static abaplintVersion() {
|
|
48895
48898
|
// magic, see build script "version.sh"
|
|
48896
|
-
return "2.102.
|
|
48899
|
+
return "2.102.43";
|
|
48897
48900
|
}
|
|
48898
48901
|
getDDICReferences() {
|
|
48899
48902
|
return this.ddicReferences;
|
|
@@ -51561,7 +51564,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
|
51561
51564
|
if (statement.get() instanceof _statement_1.Comment) {
|
|
51562
51565
|
continue;
|
|
51563
51566
|
}
|
|
51564
|
-
else if (statement.get() instanceof Statements.EndIf
|
|
51567
|
+
else if (statement.get() instanceof Statements.EndIf
|
|
51568
|
+
|| statement.get() instanceof Statements.EndTestSeam) {
|
|
51565
51569
|
continue;
|
|
51566
51570
|
}
|
|
51567
51571
|
else {
|
|
@@ -51588,7 +51592,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
|
51588
51592
|
return true;
|
|
51589
51593
|
}
|
|
51590
51594
|
}
|
|
51591
|
-
else if (statement.get() instanceof Statements.EndIf
|
|
51595
|
+
else if (statement.get() instanceof Statements.EndIf
|
|
51596
|
+
|| statement.get() instanceof Statements.EndTestSeam) {
|
|
51592
51597
|
continue;
|
|
51593
51598
|
}
|
|
51594
51599
|
else {
|
|
@@ -61182,7 +61187,9 @@ class MethodLength {
|
|
|
61182
61187
|
key: "method_length",
|
|
61183
61188
|
title: "Method/Form Length",
|
|
61184
61189
|
shortDescription: `Checks relating to method/form length.`,
|
|
61185
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
61190
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
61191
|
+
|
|
61192
|
+
Abstract methods without statements are considered okay.`,
|
|
61186
61193
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61187
61194
|
};
|
|
61188
61195
|
}
|
|
@@ -61227,6 +61234,9 @@ class MethodLength {
|
|
|
61227
61234
|
continue;
|
|
61228
61235
|
}
|
|
61229
61236
|
if (s.count === 0 && this.conf.errorWhenEmpty === true) {
|
|
61237
|
+
if (this.isAbstract(s)) {
|
|
61238
|
+
continue;
|
|
61239
|
+
}
|
|
61230
61240
|
const issue = issue_1.Issue.atPosition(s.file, s.pos, this.getDescription(IssueType.EmptyMethod, "0", type), this.getMetadata().key, this.conf.severity);
|
|
61231
61241
|
issues.push(issue);
|
|
61232
61242
|
continue;
|
|
@@ -61239,6 +61249,10 @@ class MethodLength {
|
|
|
61239
61249
|
}
|
|
61240
61250
|
return issues;
|
|
61241
61251
|
}
|
|
61252
|
+
isAbstract(result) {
|
|
61253
|
+
const cdef = result.file.getInfo().getClassDefinitionByName(result.className);
|
|
61254
|
+
return (cdef === null || cdef === void 0 ? void 0 : cdef.isAbstract) === true;
|
|
61255
|
+
}
|
|
61242
61256
|
}
|
|
61243
61257
|
exports.MethodLength = MethodLength;
|
|
61244
61258
|
//# sourceMappingURL=method_length.js.map
|
|
@@ -68809,6 +68823,8 @@ class UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
68809
68823
|
* @uniqueItems true
|
|
68810
68824
|
*/
|
|
68811
68825
|
this.skipNames = [];
|
|
68826
|
+
/** skip parameters from abstract methods */
|
|
68827
|
+
this.skipAbstract = false;
|
|
68812
68828
|
}
|
|
68813
68829
|
}
|
|
68814
68830
|
exports.UnusedVariablesConf = UnusedVariablesConf;
|
|
@@ -68951,6 +68967,9 @@ Errors found in INCLUDES are reported for the main program.`,
|
|
|
68951
68967
|
&& this.conf.skipNames.some((a) => a.toUpperCase() === name)) {
|
|
68952
68968
|
continue;
|
|
68953
68969
|
}
|
|
68970
|
+
else if (this.conf.skipAbstract === true && meta.includes("abstract" /* IdentifierMeta.Abstract */)) {
|
|
68971
|
+
continue;
|
|
68972
|
+
}
|
|
68954
68973
|
else if (name === "ME"
|
|
68955
68974
|
|| name === "SUPER"
|
|
68956
68975
|
|| meta.includes("selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */)
|
|
@@ -70096,7 +70115,7 @@ class FormLengthStats {
|
|
|
70096
70115
|
}
|
|
70097
70116
|
else if (type instanceof Statements.EndForm) {
|
|
70098
70117
|
if (pos) {
|
|
70099
|
-
res.push({ name, count, file, pos });
|
|
70118
|
+
res.push({ name: name, className: "", count, file, pos });
|
|
70100
70119
|
}
|
|
70101
70120
|
else {
|
|
70102
70121
|
continue;
|
|
@@ -70349,31 +70368,37 @@ exports.IncludeGraph = IncludeGraph;
|
|
|
70349
70368
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
70350
70369
|
exports.MethodLengthStats = void 0;
|
|
70351
70370
|
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
70371
|
+
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
70352
70372
|
const expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
70353
70373
|
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
70354
70374
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
70355
70375
|
class MethodLengthStats {
|
|
70356
70376
|
static run(obj) {
|
|
70377
|
+
var _a;
|
|
70357
70378
|
const res = [];
|
|
70358
70379
|
let pos = undefined;
|
|
70359
|
-
let
|
|
70380
|
+
let methodName = "";
|
|
70360
70381
|
let count = 0;
|
|
70361
70382
|
let method = false;
|
|
70362
70383
|
if (!(obj instanceof _abap_object_1.ABAPObject)) {
|
|
70363
70384
|
return [];
|
|
70364
70385
|
}
|
|
70365
70386
|
for (const file of obj.getABAPFiles()) {
|
|
70387
|
+
let className = "";
|
|
70366
70388
|
for (const stat of file.getStatements()) {
|
|
70367
70389
|
const type = stat.get();
|
|
70368
70390
|
if (type instanceof Statements.MethodImplementation) {
|
|
70369
70391
|
pos = stat.getFirstToken().getStart();
|
|
70370
|
-
|
|
70392
|
+
methodName = this.findName(stat);
|
|
70371
70393
|
method = true;
|
|
70372
70394
|
count = 0;
|
|
70373
70395
|
}
|
|
70396
|
+
else if (type instanceof Statements.ClassImplementation) {
|
|
70397
|
+
className = ((_a = stat.findFirstExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || "INTERNAL_ERROR";
|
|
70398
|
+
}
|
|
70374
70399
|
else if (type instanceof Statements.EndMethod) {
|
|
70375
70400
|
if (pos) {
|
|
70376
|
-
res.push({ name, count, file, pos });
|
|
70401
|
+
res.push({ name: methodName, className, count, file, pos });
|
|
70377
70402
|
}
|
|
70378
70403
|
else {
|
|
70379
70404
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.43",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.102.
|
|
41
|
+
"@abaplint/core": "^2.102.43",
|
|
42
42
|
"@types/chai": "^4.3.6",
|
|
43
43
|
"@types/glob": "^7.2.0",
|
|
44
44
|
"@types/minimist": "^1.2.2",
|
|
45
45
|
"@types/mocha": "^10.0.1",
|
|
46
|
-
"@types/node": "^20.6.
|
|
46
|
+
"@types/node": "^20.6.2",
|
|
47
47
|
"@types/progress": "^2.0.5",
|
|
48
48
|
"chai": "^4.3.8",
|
|
49
49
|
"chalk": "^5.3.0",
|
|
50
50
|
"eslint": "^8.49.0",
|
|
51
51
|
"glob": "^7.2.3",
|
|
52
52
|
"json5": "^2.2.3",
|
|
53
|
-
"memfs": "^4.
|
|
53
|
+
"memfs": "^4.3.0",
|
|
54
54
|
"minimist": "^1.2.8",
|
|
55
55
|
"mocha": "^10.2.0",
|
|
56
56
|
"progress": "^2.0.3",
|