@abaplint/cli 2.101.15 → 2.101.17
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 +123 -25
- package/package.json +6 -6
package/build/cli.js
CHANGED
|
@@ -20557,12 +20557,19 @@ class CurrentScope {
|
|
|
20557
20557
|
}
|
|
20558
20558
|
}
|
|
20559
20559
|
addReference(usage, referencing, type, filename, extra) {
|
|
20560
|
-
var _a;
|
|
20560
|
+
var _a, _b;
|
|
20561
20561
|
if (usage === undefined || type === undefined) {
|
|
20562
20562
|
return;
|
|
20563
20563
|
}
|
|
20564
20564
|
const position = new _identifier_1.Identifier(usage, filename);
|
|
20565
|
-
|
|
20565
|
+
if (Array.isArray(type)) {
|
|
20566
|
+
for (const t of type) {
|
|
20567
|
+
(_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: t, extra });
|
|
20568
|
+
}
|
|
20569
|
+
}
|
|
20570
|
+
else {
|
|
20571
|
+
(_b = this.current) === null || _b === void 0 ? void 0 : _b.getData().references.push({ position, resolved: referencing, referenceType: type, extra });
|
|
20572
|
+
}
|
|
20566
20573
|
}
|
|
20567
20574
|
addSQLConversion(fieldName, message, token) {
|
|
20568
20575
|
var _a;
|
|
@@ -21508,6 +21515,7 @@ class TypeUtils {
|
|
|
21508
21515
|
else if (type instanceof basic_1.XStringType
|
|
21509
21516
|
|| type instanceof basic_1.HexType
|
|
21510
21517
|
|| type instanceof basic_1.VoidType
|
|
21518
|
+
|| type instanceof basic_1.XGenericType
|
|
21511
21519
|
|| type instanceof basic_1.XSequenceType
|
|
21512
21520
|
|| type instanceof basic_1.AnyType
|
|
21513
21521
|
|| type instanceof basic_1.UnknownType) {
|
|
@@ -21624,12 +21632,15 @@ class TypeUtils {
|
|
|
21624
21632
|
}
|
|
21625
21633
|
return false;
|
|
21626
21634
|
}
|
|
21627
|
-
isAssignableStrict(source, target) {
|
|
21635
|
+
isAssignableStrict(source, target, containsMethodCall = false) {
|
|
21628
21636
|
var _a, _b, _c, _d, _e, _f;
|
|
21629
21637
|
/*
|
|
21630
21638
|
console.dir(source);
|
|
21631
21639
|
console.dir(target);
|
|
21632
21640
|
*/
|
|
21641
|
+
if (containsMethodCall) {
|
|
21642
|
+
return this.isAssignable(source, target);
|
|
21643
|
+
}
|
|
21633
21644
|
if (source instanceof basic_1.CharacterType) {
|
|
21634
21645
|
if (target instanceof basic_1.CharacterType) {
|
|
21635
21646
|
if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
|
|
@@ -21850,7 +21861,7 @@ class BasicTypes {
|
|
|
21850
21861
|
}
|
|
21851
21862
|
lookupQualifiedName(name) {
|
|
21852
21863
|
var _a;
|
|
21853
|
-
// argh, todo, rewrite this entire method, more argh
|
|
21864
|
+
// argh, todo, rewrite this entire method, more argh, again argh
|
|
21854
21865
|
if (name === undefined) {
|
|
21855
21866
|
return undefined;
|
|
21856
21867
|
}
|
|
@@ -21871,7 +21882,10 @@ class BasicTypes {
|
|
|
21871
21882
|
const stru = oo.getTypeDefinitions().getByName(subTypeName);
|
|
21872
21883
|
const struType = stru === null || stru === void 0 ? void 0 : stru.getType();
|
|
21873
21884
|
if (stru && struType instanceof basic_1.StructureType) {
|
|
21874
|
-
|
|
21885
|
+
let f = struType.getComponentByName(fieldName);
|
|
21886
|
+
if (split[2] && f instanceof basic_1.StructureType) {
|
|
21887
|
+
f = f.getComponentByName(split[2]);
|
|
21888
|
+
}
|
|
21875
21889
|
if (f) {
|
|
21876
21890
|
return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);
|
|
21877
21891
|
}
|
|
@@ -21893,7 +21907,10 @@ class BasicTypes {
|
|
|
21893
21907
|
if (type) {
|
|
21894
21908
|
const stru = type.getType();
|
|
21895
21909
|
if (stru instanceof basic_1.StructureType) {
|
|
21896
|
-
|
|
21910
|
+
let f = stru.getComponentByName(fieldName);
|
|
21911
|
+
if (split[2] && f instanceof basic_1.StructureType) {
|
|
21912
|
+
f = f.getComponentByName(split[2]);
|
|
21913
|
+
}
|
|
21897
21914
|
if (f) {
|
|
21898
21915
|
return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);
|
|
21899
21916
|
}
|
|
@@ -22794,7 +22811,9 @@ class AttributeChain {
|
|
|
22794
22811
|
if (context === undefined) {
|
|
22795
22812
|
throw new Error("Attribute or constant \"" + name + "\" not found in \"" + def.getName() + "\"");
|
|
22796
22813
|
}
|
|
22797
|
-
|
|
22814
|
+
for (const t of type) {
|
|
22815
|
+
scope.addReference(nameToken, context, t, filename);
|
|
22816
|
+
}
|
|
22798
22817
|
// todo, loop, handle ArrowOrDash, ComponentName, TableExpression
|
|
22799
22818
|
return context.getType();
|
|
22800
22819
|
}
|
|
@@ -24598,7 +24617,7 @@ class MethodCallParam {
|
|
|
24598
24617
|
if (sourceType === undefined) {
|
|
24599
24618
|
throw new Error("No source type determined, method source");
|
|
24600
24619
|
}
|
|
24601
|
-
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
|
|
24620
|
+
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType, child.findFirstExpression(Expressions.MethodCallChain) !== undefined) === false) {
|
|
24602
24621
|
throw new Error("Method parameter type not compatible");
|
|
24603
24622
|
}
|
|
24604
24623
|
}
|
|
@@ -24699,6 +24718,9 @@ class MethodParam {
|
|
|
24699
24718
|
if (concat === "TYPE C" || concat.startsWith("TYPE C ")) {
|
|
24700
24719
|
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new cgeneric_type_1.CGenericType(), meta);
|
|
24701
24720
|
}
|
|
24721
|
+
else if (concat === "TYPE X" || concat.startsWith("TYPE X ")) {
|
|
24722
|
+
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new basic_1.XGenericType(), meta);
|
|
24723
|
+
}
|
|
24702
24724
|
const found = new basic_types_1.BasicTypes(filename, scope).parseType(type);
|
|
24703
24725
|
if (found) {
|
|
24704
24726
|
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, found, meta);
|
|
@@ -25500,7 +25522,7 @@ const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifie
|
|
|
25500
25522
|
* DATA(bar) = VALUE #( ... ). give error, no type can be derived
|
|
25501
25523
|
*/
|
|
25502
25524
|
class Source {
|
|
25503
|
-
runSyntax(node, scope, filename, targetType) {
|
|
25525
|
+
runSyntax(node, scope, filename, targetType, writeReference = false) {
|
|
25504
25526
|
if (node === undefined) {
|
|
25505
25527
|
return undefined;
|
|
25506
25528
|
}
|
|
@@ -25627,12 +25649,16 @@ class Source {
|
|
|
25627
25649
|
return undefined;
|
|
25628
25650
|
}
|
|
25629
25651
|
let context = new unknown_type_1.UnknownType("todo, Source type");
|
|
25652
|
+
const type = [_reference_1.ReferenceType.DataReadReference];
|
|
25653
|
+
if (writeReference) {
|
|
25654
|
+
type.push(_reference_1.ReferenceType.DataWriteReference);
|
|
25655
|
+
}
|
|
25630
25656
|
while (children.length >= 0) {
|
|
25631
25657
|
if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.MethodCallChain) {
|
|
25632
25658
|
context = new method_call_chain_1.MethodCallChain().runSyntax(first, scope, filename, targetType);
|
|
25633
25659
|
}
|
|
25634
25660
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.FieldChain) {
|
|
25635
|
-
context = new field_chain_1.FieldChain().runSyntax(first, scope, filename,
|
|
25661
|
+
context = new field_chain_1.FieldChain().runSyntax(first, scope, filename, type);
|
|
25636
25662
|
}
|
|
25637
25663
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.StringTemplate) {
|
|
25638
25664
|
context = new string_template_1.StringTemplate().runSyntax(first, scope, filename);
|
|
@@ -25645,15 +25671,14 @@ class Source {
|
|
|
25645
25671
|
}
|
|
25646
25672
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dereference) {
|
|
25647
25673
|
context = new dereference_1.Dereference().runSyntax(context);
|
|
25648
|
-
|
|
25649
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ArrowOrDash) {
|
|
25674
|
+
// } else if (first instanceof ExpressionNode && first.get() instanceof Expressions.ArrowOrDash) {
|
|
25650
25675
|
// console.dir("dash");
|
|
25651
25676
|
}
|
|
25652
25677
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ComponentChain) {
|
|
25653
25678
|
context = new component_chain_1.ComponentChain().runSyntax(context, first, scope, filename);
|
|
25654
25679
|
}
|
|
25655
25680
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.AttributeChain) {
|
|
25656
|
-
context = new attribute_chain_1.AttributeChain().runSyntax(context, first, scope, filename,
|
|
25681
|
+
context = new attribute_chain_1.AttributeChain().runSyntax(context, first, scope, filename, type);
|
|
25657
25682
|
}
|
|
25658
25683
|
first = children.shift();
|
|
25659
25684
|
if (first === undefined) {
|
|
@@ -29285,12 +29310,13 @@ class Loop {
|
|
|
29285
29310
|
if (target === undefined) {
|
|
29286
29311
|
target = node.findDirectExpression(Expressions.FSTarget);
|
|
29287
29312
|
}
|
|
29313
|
+
const write = (loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectTokenByText("ASSIGNING")) !== undefined;
|
|
29288
29314
|
const sources = node.findDirectExpressions(Expressions.Source);
|
|
29289
29315
|
let firstSource = node.findDirectExpression(Expressions.SimpleSource2);
|
|
29290
29316
|
if (firstSource === undefined) {
|
|
29291
29317
|
firstSource = sources[0];
|
|
29292
29318
|
}
|
|
29293
|
-
let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType) : undefined;
|
|
29319
|
+
let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType, write) : undefined;
|
|
29294
29320
|
let rowType = undefined;
|
|
29295
29321
|
const concat = node.concatTokens().toUpperCase();
|
|
29296
29322
|
if (sourceType === undefined) {
|
|
@@ -34708,7 +34734,7 @@ class HexType extends _abstract_type_1.AbstractType {
|
|
|
34708
34734
|
constructor(length, qualifiedName) {
|
|
34709
34735
|
super({ qualifiedName: qualifiedName });
|
|
34710
34736
|
if (length <= 0) {
|
|
34711
|
-
throw new Error("Bad
|
|
34737
|
+
throw new Error("Bad LENGTH, Hex");
|
|
34712
34738
|
}
|
|
34713
34739
|
this.length = length;
|
|
34714
34740
|
}
|
|
@@ -34787,6 +34813,7 @@ __exportStar(__webpack_require__(/*! ./time_type */ "./node_modules/@abaplint/co
|
|
|
34787
34813
|
__exportStar(__webpack_require__(/*! ./unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js"), exports);
|
|
34788
34814
|
__exportStar(__webpack_require__(/*! ./utc_long_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/utc_long_type.js"), exports);
|
|
34789
34815
|
__exportStar(__webpack_require__(/*! ./void_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js"), exports);
|
|
34816
|
+
__exportStar(__webpack_require__(/*! ./xgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/xgeneric_type.js"), exports);
|
|
34790
34817
|
__exportStar(__webpack_require__(/*! ./xsequence_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js"), exports);
|
|
34791
34818
|
__exportStar(__webpack_require__(/*! ./xstring_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/xstring_type.js"), exports);
|
|
34792
34819
|
//# sourceMappingURL=index.js.map
|
|
@@ -35427,6 +35454,39 @@ exports.VoidType = VoidType;
|
|
|
35427
35454
|
|
|
35428
35455
|
/***/ }),
|
|
35429
35456
|
|
|
35457
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/xgeneric_type.js":
|
|
35458
|
+
/*!*********************************************************************************!*\
|
|
35459
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/types/basic/xgeneric_type.js ***!
|
|
35460
|
+
\*********************************************************************************/
|
|
35461
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
35462
|
+
|
|
35463
|
+
"use strict";
|
|
35464
|
+
|
|
35465
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35466
|
+
exports.XGenericType = void 0;
|
|
35467
|
+
const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
|
|
35468
|
+
class XGenericType extends _abstract_type_1.AbstractType {
|
|
35469
|
+
toText() {
|
|
35470
|
+
return "```x```";
|
|
35471
|
+
}
|
|
35472
|
+
isGeneric() {
|
|
35473
|
+
return true;
|
|
35474
|
+
}
|
|
35475
|
+
toABAP() {
|
|
35476
|
+
throw new Error("x, generic");
|
|
35477
|
+
}
|
|
35478
|
+
containsVoid() {
|
|
35479
|
+
return false;
|
|
35480
|
+
}
|
|
35481
|
+
toCDS() {
|
|
35482
|
+
return "abap.TODO_CGENERIC";
|
|
35483
|
+
}
|
|
35484
|
+
}
|
|
35485
|
+
exports.XGenericType = XGenericType;
|
|
35486
|
+
//# sourceMappingURL=xgeneric_type.js.map
|
|
35487
|
+
|
|
35488
|
+
/***/ }),
|
|
35489
|
+
|
|
35430
35490
|
/***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js":
|
|
35431
35491
|
/*!**********************************************************************************!*\
|
|
35432
35492
|
!*** ./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js ***!
|
|
@@ -48352,7 +48412,7 @@ class Registry {
|
|
|
48352
48412
|
}
|
|
48353
48413
|
static abaplintVersion() {
|
|
48354
48414
|
// magic, see build script "version.sh"
|
|
48355
|
-
return "2.101.
|
|
48415
|
+
return "2.101.17";
|
|
48356
48416
|
}
|
|
48357
48417
|
getDDICReferences() {
|
|
48358
48418
|
return this.ddicReferences;
|
|
@@ -48993,7 +49053,9 @@ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */
|
|
|
48993
49053
|
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
48994
49054
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
48995
49055
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
49056
|
+
const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
|
|
48996
49057
|
const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
49058
|
+
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
48997
49059
|
class AlignParametersConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
48998
49060
|
}
|
|
48999
49061
|
exports.AlignParametersConf = AlignParametersConf;
|
|
@@ -49020,8 +49082,9 @@ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-par
|
|
|
49020
49082
|
|
|
49021
49083
|
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
49022
49084
|
|
|
49023
|
-
|
|
49024
|
-
|
|
49085
|
+
If parameters are on the same row, no issues are reported, see
|
|
49086
|
+
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
49087
|
+
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
49025
49088
|
badExample: `CALL FUNCTION 'FOOBAR'
|
|
49026
49089
|
EXPORTING
|
|
49027
49090
|
foo = 2
|
|
@@ -49083,16 +49146,28 @@ DATA(sdf) = VALUE type(
|
|
|
49083
49146
|
return undefined;
|
|
49084
49147
|
}
|
|
49085
49148
|
let expectedEqualsColumn = 0;
|
|
49149
|
+
let row = 0;
|
|
49086
49150
|
for (const p of candidate.parameters) {
|
|
49087
49151
|
const currentCol = p.left.getLastToken().getCol() + p.left.getLastToken().getStr().length + 1;
|
|
49152
|
+
if (p.eq.getRow() === row) {
|
|
49153
|
+
return undefined;
|
|
49154
|
+
}
|
|
49155
|
+
row = p.eq.getRow();
|
|
49088
49156
|
if (currentCol > expectedEqualsColumn) {
|
|
49089
49157
|
expectedEqualsColumn = currentCol;
|
|
49090
49158
|
}
|
|
49091
49159
|
}
|
|
49092
49160
|
for (const p of candidate.parameters) {
|
|
49093
49161
|
if (p.eq.getCol() !== expectedEqualsColumn) {
|
|
49162
|
+
let fix;
|
|
49163
|
+
if (p.eq.getCol() < expectedEqualsColumn) {
|
|
49164
|
+
fix = edit_helper_1.EditHelper.insertAt(file, p.eq, " ".repeat(expectedEqualsColumn - p.eq.getCol()));
|
|
49165
|
+
}
|
|
49166
|
+
else {
|
|
49167
|
+
fix = edit_helper_1.EditHelper.deleteRange(file, new position_1.Position(p.eq.getRow(), expectedEqualsColumn), p.eq);
|
|
49168
|
+
}
|
|
49094
49169
|
const message = "Align parameters to column " + expectedEqualsColumn;
|
|
49095
|
-
return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key, this.getConfig().severity);
|
|
49170
|
+
return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key, this.getConfig().severity, fix);
|
|
49096
49171
|
}
|
|
49097
49172
|
}
|
|
49098
49173
|
return undefined;
|
|
@@ -56885,11 +56960,11 @@ DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
|
56885
56960
|
const concat = tt.concatTokens().toUpperCase();
|
|
56886
56961
|
if (concat.includes("TYPE TABLE OF")) {
|
|
56887
56962
|
const message = "Specify table type";
|
|
56888
|
-
issues.push(issue_1.Issue.
|
|
56963
|
+
issues.push(issue_1.Issue.atPosition(file, tt.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity));
|
|
56889
56964
|
}
|
|
56890
56965
|
else if (concat.includes(" WITH ") === false && concat.includes(" RANGE OF ") === false) {
|
|
56891
56966
|
const message = "Specify table key";
|
|
56892
|
-
issues.push(issue_1.Issue.
|
|
56967
|
+
issues.push(issue_1.Issue.atPosition(file, tt.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity));
|
|
56893
56968
|
}
|
|
56894
56969
|
}
|
|
56895
56970
|
return issues;
|
|
@@ -64669,7 +64744,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
64669
64744
|
exports.SelectSingleFullKey = exports.SelectSingleFullKeyConf = void 0;
|
|
64670
64745
|
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
64671
64746
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
64672
|
-
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
64673
64747
|
const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
64674
64748
|
class SelectSingleFullKeyConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
64675
64749
|
constructor() {
|
|
@@ -64689,7 +64763,7 @@ class SelectSingleFullKey {
|
|
|
64689
64763
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
64690
64764
|
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace`,
|
|
64691
64765
|
pseudoComment: "EC CI_NOORDER",
|
|
64692
|
-
tags: [
|
|
64766
|
+
tags: [],
|
|
64693
64767
|
};
|
|
64694
64768
|
}
|
|
64695
64769
|
initialize(reg) {
|
|
@@ -66982,6 +67056,12 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
|
|
|
66982
67056
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
66983
67057
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
66984
67058
|
class UnnecessaryPragmaConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
67059
|
+
constructor() {
|
|
67060
|
+
super(...arguments);
|
|
67061
|
+
/** Allow NO_TEXT in global CLAS and INTF definitions,
|
|
67062
|
+
its added automatically by SE24 in some cases where it should not */
|
|
67063
|
+
this.allowNoTextGlobal = false;
|
|
67064
|
+
}
|
|
66985
67065
|
}
|
|
66986
67066
|
exports.UnnecessaryPragmaConf = UnnecessaryPragmaConf;
|
|
66987
67067
|
class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
@@ -67031,6 +67111,7 @@ ENDIF.`,
|
|
|
67031
67111
|
runParsed(file) {
|
|
67032
67112
|
const issues = [];
|
|
67033
67113
|
let noHandler = false;
|
|
67114
|
+
let globalDefinition = false;
|
|
67034
67115
|
const statements = file.getStatements();
|
|
67035
67116
|
for (let i = 0; i < statements.length; i++) {
|
|
67036
67117
|
const statement = statements[i];
|
|
@@ -67038,6 +67119,16 @@ ENDIF.`,
|
|
|
67038
67119
|
if (statement.get() instanceof Statements.EndTry) {
|
|
67039
67120
|
noHandler = false;
|
|
67040
67121
|
}
|
|
67122
|
+
else if (statement.get() instanceof Statements.ClassDefinition
|
|
67123
|
+
|| statement.get() instanceof Statements.Interface) {
|
|
67124
|
+
if (statement.findDirectExpression(Expressions.ClassGlobal)) {
|
|
67125
|
+
globalDefinition = true;
|
|
67126
|
+
}
|
|
67127
|
+
}
|
|
67128
|
+
else if (statement.get() instanceof Statements.EndClass
|
|
67129
|
+
|| statement.get() instanceof Statements.EndInterface) {
|
|
67130
|
+
globalDefinition = false;
|
|
67131
|
+
}
|
|
67041
67132
|
else if (statement.get() instanceof _statement_1.Comment) {
|
|
67042
67133
|
continue;
|
|
67043
67134
|
}
|
|
@@ -67050,9 +67141,16 @@ ENDIF.`,
|
|
|
67050
67141
|
else {
|
|
67051
67142
|
noHandler = this.containsNoHandler(statement, statements[i + 1]);
|
|
67052
67143
|
}
|
|
67053
|
-
|
|
67144
|
+
if (this.getConfig().allowNoTextGlobal === true && globalDefinition === true) {
|
|
67145
|
+
// skip
|
|
67146
|
+
}
|
|
67147
|
+
else {
|
|
67148
|
+
issues.push(...this.checkText(statement, file));
|
|
67149
|
+
}
|
|
67054
67150
|
issues.push(...this.checkNeeded(statement, file));
|
|
67055
|
-
|
|
67151
|
+
if (globalDefinition === false) {
|
|
67152
|
+
issues.push(...this.checkSubrc(statement, nextStatement, file));
|
|
67153
|
+
}
|
|
67056
67154
|
}
|
|
67057
67155
|
return issues;
|
|
67058
67156
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.101.
|
|
3
|
+
"version": "2.101.17",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,25 +38,25 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.101.
|
|
41
|
+
"@abaplint/core": "^2.101.17",
|
|
42
42
|
"@types/chai": "^4.3.5",
|
|
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.2.
|
|
46
|
+
"@types/node": "^20.2.6",
|
|
47
47
|
"@types/progress": "^2.0.5",
|
|
48
48
|
"chai": "^4.3.7",
|
|
49
49
|
"chalk": "^5.2.0",
|
|
50
50
|
"eslint": "^8.42.0",
|
|
51
51
|
"glob": "^7.2.3",
|
|
52
52
|
"json5": "^2.2.3",
|
|
53
|
-
"memfs": "^3.5.
|
|
53
|
+
"memfs": "^3.5.3",
|
|
54
54
|
"minimist": "^1.2.8",
|
|
55
55
|
"mocha": "^10.2.0",
|
|
56
56
|
"progress": "^2.0.3",
|
|
57
57
|
"typescript": "^5.1.3",
|
|
58
|
-
"webpack": "^5.
|
|
59
|
-
"webpack-cli": "^5.1.
|
|
58
|
+
"webpack": "^5.86.0",
|
|
59
|
+
"webpack-cli": "^5.1.4",
|
|
60
60
|
"xml-js": "^1.6.11"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {}
|