@abaplint/cli 2.112.22 → 2.113.0
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 +368 -52
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -35199,36 +35199,18 @@ exports.FlowGraph = FlowGraph;
|
|
|
35199
35199
|
|
|
35200
35200
|
/***/ }),
|
|
35201
35201
|
|
|
35202
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/
|
|
35203
|
-
|
|
35204
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/
|
|
35205
|
-
|
|
35202
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js":
|
|
35203
|
+
/*!*****************************************************************************!*\
|
|
35204
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js ***!
|
|
35205
|
+
\*****************************************************************************/
|
|
35206
35206
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
35207
35207
|
|
|
35208
35208
|
"use strict";
|
|
35209
35209
|
|
|
35210
35210
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35211
|
-
exports.
|
|
35212
|
-
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
35213
|
-
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
35211
|
+
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
35214
35212
|
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
35215
|
-
|
|
35216
|
-
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
35217
|
-
// Levels: top, FORM, METHOD, FUNCTION-MODULE, (MODULE, AT, END-OF-*, GET, START-OF-SELECTION, TOP-OF-PAGE)
|
|
35218
|
-
//
|
|
35219
|
-
// Loop branching: LOOP, DO, WHILE, SELECT(loop), WITH, PROVIDE
|
|
35220
|
-
//
|
|
35221
|
-
// Branching: IF, CASE, CASE TYPE OF, TRY, ON, CATCH SYSTEM-EXCEPTIONS, AT
|
|
35222
|
-
//
|
|
35223
|
-
// Conditional exits: CHECK, ASSERT
|
|
35224
|
-
//
|
|
35225
|
-
// Exits: RETURN, EXIT, RAISE(not RESUMABLE), MESSAGE(type E and A?), CONTINUE, REJECT, RESUME, STOP
|
|
35226
|
-
//
|
|
35227
|
-
// Not handled? INCLUDE + malplaced macro calls
|
|
35228
|
-
/////////////////////////////////////
|
|
35229
|
-
// TODO: handling static exceptions(only static), refactor some logic from UncaughtException to common file
|
|
35230
|
-
// TODO: RAISE
|
|
35231
|
-
const FLOW_EVENTS = [
|
|
35213
|
+
exports.SELECTION_EVENTS = [
|
|
35232
35214
|
Statements.StartOfSelection,
|
|
35233
35215
|
Statements.AtSelectionScreen,
|
|
35234
35216
|
Statements.AtLineSelection,
|
|
@@ -35238,11 +35220,40 @@ const FLOW_EVENTS = [
|
|
|
35238
35220
|
Statements.TopOfPage,
|
|
35239
35221
|
Statements.EndOfPage,
|
|
35240
35222
|
];
|
|
35223
|
+
exports.DECLARATION_STUFF = [
|
|
35224
|
+
Statements.Data,
|
|
35225
|
+
Statements.DataBegin,
|
|
35226
|
+
Statements.Constant,
|
|
35227
|
+
Statements.Parameter,
|
|
35228
|
+
Statements.SelectionScreen,
|
|
35229
|
+
Statements.ConstantBegin,
|
|
35230
|
+
];
|
|
35231
|
+
//# sourceMappingURL=selection_events.js.map
|
|
35232
|
+
|
|
35233
|
+
/***/ }),
|
|
35234
|
+
|
|
35235
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js":
|
|
35236
|
+
/*!***************************************************************************!*\
|
|
35237
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js ***!
|
|
35238
|
+
\***************************************************************************/
|
|
35239
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
35240
|
+
|
|
35241
|
+
"use strict";
|
|
35242
|
+
|
|
35243
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35244
|
+
exports.StatementFlow = void 0;
|
|
35245
|
+
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
35246
|
+
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
35247
|
+
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
35248
|
+
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
35249
|
+
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
35250
|
+
const objects_1 = __webpack_require__(/*! ../../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
35251
|
+
const selection_events_1 = __webpack_require__(/*! ./selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
35241
35252
|
class StatementFlow {
|
|
35242
35253
|
constructor() {
|
|
35243
35254
|
this.counter = 0;
|
|
35244
35255
|
}
|
|
35245
|
-
build(stru) {
|
|
35256
|
+
build(stru, obj) {
|
|
35246
35257
|
var _a, _b, _c, _d;
|
|
35247
35258
|
const ret = [];
|
|
35248
35259
|
let name = "";
|
|
@@ -35268,36 +35279,38 @@ class StatementFlow {
|
|
|
35268
35279
|
throw new Error("StatementFlow, unknown structure");
|
|
35269
35280
|
}
|
|
35270
35281
|
}
|
|
35271
|
-
|
|
35272
|
-
|
|
35273
|
-
|
|
35274
|
-
|
|
35275
|
-
|
|
35276
|
-
if (
|
|
35277
|
-
|
|
35282
|
+
if (obj instanceof objects_1.Program) {
|
|
35283
|
+
// find the top level events
|
|
35284
|
+
let inEvent = false;
|
|
35285
|
+
let collected = [];
|
|
35286
|
+
for (const s of stru.getChildren() || []) {
|
|
35287
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
35288
|
+
if (inEvent === true) {
|
|
35289
|
+
ret.push(this.runEvent(collected, name));
|
|
35290
|
+
}
|
|
35291
|
+
collected = [];
|
|
35292
|
+
inEvent = true;
|
|
35293
|
+
name = s.concatTokens();
|
|
35294
|
+
}
|
|
35295
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
35296
|
+
collected.push(s);
|
|
35297
|
+
}
|
|
35298
|
+
else {
|
|
35299
|
+
if (inEvent === true) {
|
|
35300
|
+
ret.push(this.runEvent(collected, name));
|
|
35301
|
+
inEvent = false;
|
|
35302
|
+
}
|
|
35303
|
+
collected = [];
|
|
35278
35304
|
}
|
|
35279
|
-
collected = [];
|
|
35280
|
-
inFlow = true;
|
|
35281
|
-
name = s.concatTokens();
|
|
35282
35305
|
}
|
|
35283
|
-
|
|
35284
|
-
|
|
35306
|
+
if (inEvent === true) {
|
|
35307
|
+
ret.push(this.runEvent(collected, name));
|
|
35285
35308
|
}
|
|
35286
|
-
else {
|
|
35287
|
-
|
|
35288
|
-
|
|
35289
|
-
inFlow = false;
|
|
35290
|
-
}
|
|
35291
|
-
collected = [];
|
|
35309
|
+
else if (collected.length > 0) {
|
|
35310
|
+
// implicit START-OF-SELECTION
|
|
35311
|
+
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
35292
35312
|
}
|
|
35293
35313
|
}
|
|
35294
|
-
if (inFlow === true) {
|
|
35295
|
-
ret.push(this.runEvent(collected, name));
|
|
35296
|
-
}
|
|
35297
|
-
else if (collected.length > 0) {
|
|
35298
|
-
// implicit START-OF-SELECTION
|
|
35299
|
-
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
35300
|
-
}
|
|
35301
35314
|
return ret.map(f => f.reduce());
|
|
35302
35315
|
}
|
|
35303
35316
|
////////////////////
|
|
@@ -44004,11 +44017,15 @@ class LanguageServer {
|
|
|
44004
44017
|
if (file === undefined) {
|
|
44005
44018
|
return "file not found";
|
|
44006
44019
|
}
|
|
44020
|
+
const obj = this.reg.findObjectForFile(file);
|
|
44021
|
+
if (obj === undefined) {
|
|
44022
|
+
return "obj not found";
|
|
44023
|
+
}
|
|
44007
44024
|
const stru = file.getStructure();
|
|
44008
44025
|
if (stru === undefined) {
|
|
44009
44026
|
return "empty structure";
|
|
44010
44027
|
}
|
|
44011
|
-
const graphs = new statement_flow_1.StatementFlow().build(stru);
|
|
44028
|
+
const graphs = new statement_flow_1.StatementFlow().build(stru, obj);
|
|
44012
44029
|
const wiz = graphs.map(g => g.toDigraph());
|
|
44013
44030
|
return JSON.stringify(wiz);
|
|
44014
44031
|
}
|
|
@@ -52623,7 +52640,7 @@ class Registry {
|
|
|
52623
52640
|
}
|
|
52624
52641
|
static abaplintVersion() {
|
|
52625
52642
|
// magic, see build script "version.sh"
|
|
52626
|
-
return "2.
|
|
52643
|
+
return "2.113.0";
|
|
52627
52644
|
}
|
|
52628
52645
|
getDDICReferences() {
|
|
52629
52646
|
return this.ddicReferences;
|
|
@@ -53261,6 +53278,111 @@ exports.Abapdoc = Abapdoc;
|
|
|
53261
53278
|
|
|
53262
53279
|
/***/ }),
|
|
53263
53280
|
|
|
53281
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js":
|
|
53282
|
+
/*!****************************************************************************!*\
|
|
53283
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js ***!
|
|
53284
|
+
\****************************************************************************/
|
|
53285
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
53286
|
+
|
|
53287
|
+
"use strict";
|
|
53288
|
+
|
|
53289
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
53290
|
+
exports.AddTestAttributes = exports.AddTestAttributesConf = void 0;
|
|
53291
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
53292
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
53293
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
53294
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
53295
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
53296
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
53297
|
+
class AddTestAttributesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
53298
|
+
}
|
|
53299
|
+
exports.AddTestAttributesConf = AddTestAttributesConf;
|
|
53300
|
+
class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
53301
|
+
constructor() {
|
|
53302
|
+
super(...arguments);
|
|
53303
|
+
this.conf = new AddTestAttributesConf();
|
|
53304
|
+
}
|
|
53305
|
+
getMetadata() {
|
|
53306
|
+
return {
|
|
53307
|
+
key: "add_test_attributes",
|
|
53308
|
+
title: "Add test attributes for tests classes with test methods",
|
|
53309
|
+
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53310
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
53311
|
+
badExample: `CLASS ltcl_test DEFINITION FINAL FOR TESTING.
|
|
53312
|
+
PUBLIC SECTION.
|
|
53313
|
+
PROTECTED SECTION.
|
|
53314
|
+
PRIVATE SECTION.
|
|
53315
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53316
|
+
ENDCLASS.
|
|
53317
|
+
|
|
53318
|
+
CLASS ltcl_test IMPLEMENTATION.
|
|
53319
|
+
METHOD test.
|
|
53320
|
+
ENDMETHOD.
|
|
53321
|
+
ENDCLASS.`,
|
|
53322
|
+
goodExample: `CLASS ltcl_test DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53323
|
+
PUBLIC SECTION.
|
|
53324
|
+
PROTECTED SECTION.
|
|
53325
|
+
PRIVATE SECTION.
|
|
53326
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53327
|
+
ENDCLASS.
|
|
53328
|
+
|
|
53329
|
+
CLASS ltcl_test IMPLEMENTATION.
|
|
53330
|
+
METHOD test.
|
|
53331
|
+
ENDMETHOD.
|
|
53332
|
+
ENDCLASS.`,
|
|
53333
|
+
};
|
|
53334
|
+
}
|
|
53335
|
+
getConfig() {
|
|
53336
|
+
return this.conf;
|
|
53337
|
+
}
|
|
53338
|
+
setConfig(conf) {
|
|
53339
|
+
this.conf = conf;
|
|
53340
|
+
}
|
|
53341
|
+
runParsed(file) {
|
|
53342
|
+
const issues = [];
|
|
53343
|
+
const stru = file.getStructure();
|
|
53344
|
+
if (stru === undefined) {
|
|
53345
|
+
return [];
|
|
53346
|
+
}
|
|
53347
|
+
for (const classStructure of stru.findAllStructures(Structures.ClassDefinition)) {
|
|
53348
|
+
const cdef = classStructure.findFirstStatement(Statements.ClassDefinition);
|
|
53349
|
+
if (cdef === undefined) {
|
|
53350
|
+
continue;
|
|
53351
|
+
}
|
|
53352
|
+
const cdefConcat = cdef === null || cdef === void 0 ? void 0 : cdef.concatTokens().toUpperCase();
|
|
53353
|
+
if ((cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" FOR TESTING")) === false) {
|
|
53354
|
+
continue;
|
|
53355
|
+
}
|
|
53356
|
+
const hasDuration = cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" DURATION ");
|
|
53357
|
+
const hasRiskLevel = cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" RISK LEVEL ");
|
|
53358
|
+
if (hasDuration === true && hasRiskLevel === true) {
|
|
53359
|
+
continue;
|
|
53360
|
+
}
|
|
53361
|
+
let hasTestMethod = false;
|
|
53362
|
+
for (const mdef of classStructure.findAllStatements(Statements.MethodDef)) {
|
|
53363
|
+
const concat = mdef.concatTokens().toUpperCase();
|
|
53364
|
+
if (concat.includes(" FOR TESTING")) {
|
|
53365
|
+
hasTestMethod = true;
|
|
53366
|
+
}
|
|
53367
|
+
}
|
|
53368
|
+
if (hasTestMethod === false) {
|
|
53369
|
+
continue;
|
|
53370
|
+
}
|
|
53371
|
+
if (hasDuration === false) {
|
|
53372
|
+
issues.push(issue_1.Issue.atStatement(file, cdef, "Add DURATION", this.getMetadata().key, this.getConfig().severity));
|
|
53373
|
+
}
|
|
53374
|
+
if (hasRiskLevel === false) {
|
|
53375
|
+
issues.push(issue_1.Issue.atStatement(file, cdef, "Add RISK LEVEL", this.getMetadata().key, this.getConfig().severity));
|
|
53376
|
+
}
|
|
53377
|
+
}
|
|
53378
|
+
return issues;
|
|
53379
|
+
}
|
|
53380
|
+
}
|
|
53381
|
+
exports.AddTestAttributes = AddTestAttributes;
|
|
53382
|
+
//# sourceMappingURL=add_test_attributes.js.map
|
|
53383
|
+
|
|
53384
|
+
/***/ }),
|
|
53385
|
+
|
|
53264
53386
|
/***/ "./node_modules/@abaplint/core/build/src/rules/align_parameters.js":
|
|
53265
53387
|
/*!*************************************************************************!*\
|
|
53266
53388
|
!*** ./node_modules/@abaplint/core/build/src/rules/align_parameters.js ***!
|
|
@@ -60684,6 +60806,94 @@ exports.EasyToFindMessages = EasyToFindMessages;
|
|
|
60684
60806
|
|
|
60685
60807
|
/***/ }),
|
|
60686
60808
|
|
|
60809
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/empty_event.js":
|
|
60810
|
+
/*!********************************************************************!*\
|
|
60811
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/empty_event.js ***!
|
|
60812
|
+
\********************************************************************/
|
|
60813
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
60814
|
+
|
|
60815
|
+
"use strict";
|
|
60816
|
+
|
|
60817
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
60818
|
+
exports.EmptyEvent = exports.EmptyEventConf = void 0;
|
|
60819
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
60820
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
60821
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
60822
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
60823
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
60824
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
60825
|
+
const selection_events_1 = __webpack_require__(/*! ../abap/flow/selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
60826
|
+
class EmptyEventConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
60827
|
+
}
|
|
60828
|
+
exports.EmptyEventConf = EmptyEventConf;
|
|
60829
|
+
class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
60830
|
+
constructor() {
|
|
60831
|
+
super(...arguments);
|
|
60832
|
+
this.conf = new EmptyEventConf();
|
|
60833
|
+
}
|
|
60834
|
+
getMetadata() {
|
|
60835
|
+
return {
|
|
60836
|
+
key: "empty_event",
|
|
60837
|
+
title: "Empty selection screen or list processing event block",
|
|
60838
|
+
shortDescription: `Empty selection screen or list processing event block`,
|
|
60839
|
+
extendedInformation: ``,
|
|
60840
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
60841
|
+
badExample: `REPORT zfoo.
|
|
60842
|
+
START-OF-SELECTION.
|
|
60843
|
+
PERFORM sdf.
|
|
60844
|
+
COMMIT WORK.
|
|
60845
|
+
END-OF-SELECTION.`,
|
|
60846
|
+
goodExample: `REPORT zfoo.
|
|
60847
|
+
START-OF-SELECTION.
|
|
60848
|
+
PERFORM sdf.
|
|
60849
|
+
COMMIT WORK.`,
|
|
60850
|
+
};
|
|
60851
|
+
}
|
|
60852
|
+
getConfig() {
|
|
60853
|
+
return this.conf;
|
|
60854
|
+
}
|
|
60855
|
+
setConfig(conf) {
|
|
60856
|
+
this.conf = conf;
|
|
60857
|
+
}
|
|
60858
|
+
runParsed(file, obj) {
|
|
60859
|
+
const issues = [];
|
|
60860
|
+
if (!(obj instanceof objects_1.Program) || obj.isInclude()) {
|
|
60861
|
+
return issues;
|
|
60862
|
+
}
|
|
60863
|
+
const stru = file.getStructure();
|
|
60864
|
+
if (stru === undefined) {
|
|
60865
|
+
return [];
|
|
60866
|
+
}
|
|
60867
|
+
let currentEvent = undefined;
|
|
60868
|
+
let children = [];
|
|
60869
|
+
for (const s of stru.getChildren() || []) {
|
|
60870
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
60871
|
+
children = [];
|
|
60872
|
+
currentEvent = s;
|
|
60873
|
+
}
|
|
60874
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
60875
|
+
const stru = s;
|
|
60876
|
+
// ignore declaration stuff
|
|
60877
|
+
if (selection_events_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
60878
|
+
continue;
|
|
60879
|
+
}
|
|
60880
|
+
children.push(s);
|
|
60881
|
+
}
|
|
60882
|
+
else {
|
|
60883
|
+
children = [];
|
|
60884
|
+
}
|
|
60885
|
+
}
|
|
60886
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
60887
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
60888
|
+
}
|
|
60889
|
+
return issues;
|
|
60890
|
+
}
|
|
60891
|
+
}
|
|
60892
|
+
exports.EmptyEvent = EmptyEvent;
|
|
60893
|
+
//# sourceMappingURL=empty_event.js.map
|
|
60894
|
+
|
|
60895
|
+
/***/ }),
|
|
60896
|
+
|
|
60687
60897
|
/***/ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js":
|
|
60688
60898
|
/*!********************************************************************************!*\
|
|
60689
60899
|
!*** ./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js ***!
|
|
@@ -63050,6 +63260,109 @@ exports.ImplementMethods = ImplementMethods;
|
|
|
63050
63260
|
|
|
63051
63261
|
/***/ }),
|
|
63052
63262
|
|
|
63263
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js":
|
|
63264
|
+
/*!************************************************************************************!*\
|
|
63265
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js ***!
|
|
63266
|
+
\************************************************************************************/
|
|
63267
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
63268
|
+
|
|
63269
|
+
"use strict";
|
|
63270
|
+
|
|
63271
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
63272
|
+
exports.ImplicitStartOfSelection = exports.ImplicitStartOfSelectionConf = void 0;
|
|
63273
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
63274
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
63275
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
63276
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
63277
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
63278
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
63279
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
63280
|
+
const selection_events_1 = __webpack_require__(/*! ../abap/flow/selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
63281
|
+
class ImplicitStartOfSelectionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
63282
|
+
}
|
|
63283
|
+
exports.ImplicitStartOfSelectionConf = ImplicitStartOfSelectionConf;
|
|
63284
|
+
class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
63285
|
+
constructor() {
|
|
63286
|
+
super(...arguments);
|
|
63287
|
+
this.conf = new ImplicitStartOfSelectionConf();
|
|
63288
|
+
}
|
|
63289
|
+
getMetadata() {
|
|
63290
|
+
return {
|
|
63291
|
+
key: "implicit_start_of_selection",
|
|
63292
|
+
title: "Implicit START-OF-SELECTION",
|
|
63293
|
+
shortDescription: `Add explicit selection screen event handling`,
|
|
63294
|
+
extendedInformation: `Only runs for executable programs
|
|
63295
|
+
|
|
63296
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63297
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
63298
|
+
badExample: `REPORT zfoo.
|
|
63299
|
+
WRITE 'hello'.`,
|
|
63300
|
+
goodExample: `REPORT zfoo.
|
|
63301
|
+
START-OF-SELECTION.
|
|
63302
|
+
WRITE 'hello'.`,
|
|
63303
|
+
};
|
|
63304
|
+
}
|
|
63305
|
+
getConfig() {
|
|
63306
|
+
return this.conf;
|
|
63307
|
+
}
|
|
63308
|
+
setConfig(conf) {
|
|
63309
|
+
this.conf = conf;
|
|
63310
|
+
}
|
|
63311
|
+
runParsed(file, obj) {
|
|
63312
|
+
const issues = [];
|
|
63313
|
+
if (!(obj instanceof objects_1.Program) || obj.isInclude()) {
|
|
63314
|
+
return issues;
|
|
63315
|
+
}
|
|
63316
|
+
const stru = file.getStructure();
|
|
63317
|
+
if (stru === undefined) {
|
|
63318
|
+
return [];
|
|
63319
|
+
}
|
|
63320
|
+
let inEvent = false;
|
|
63321
|
+
let collected = [];
|
|
63322
|
+
for (const s of stru.getChildren() || []) {
|
|
63323
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
63324
|
+
if (inEvent === false && collected.length > 0) {
|
|
63325
|
+
// implicit START-OF-SELECTION
|
|
63326
|
+
let first = collected[0];
|
|
63327
|
+
if (first instanceof nodes_1.StructureNode) {
|
|
63328
|
+
first = first.getFirstStatement();
|
|
63329
|
+
}
|
|
63330
|
+
issues.push(issue_1.Issue.atStatement(file, first, "Implicit START-OF-SELECTION", this.getMetadata().key, this.getConfig().severity));
|
|
63331
|
+
}
|
|
63332
|
+
collected = [];
|
|
63333
|
+
inEvent = true;
|
|
63334
|
+
}
|
|
63335
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
63336
|
+
const stru = s;
|
|
63337
|
+
// ignore declaration stuff
|
|
63338
|
+
if (selection_events_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
63339
|
+
continue;
|
|
63340
|
+
}
|
|
63341
|
+
collected.push(s);
|
|
63342
|
+
}
|
|
63343
|
+
else {
|
|
63344
|
+
if (inEvent === true) {
|
|
63345
|
+
inEvent = false;
|
|
63346
|
+
}
|
|
63347
|
+
collected = [];
|
|
63348
|
+
}
|
|
63349
|
+
}
|
|
63350
|
+
if (inEvent === false && collected.length > 0) {
|
|
63351
|
+
// implicit START-OF-SELECTION
|
|
63352
|
+
let first = collected[0];
|
|
63353
|
+
if (first instanceof nodes_1.StructureNode) {
|
|
63354
|
+
first = first.getFirstStatement();
|
|
63355
|
+
}
|
|
63356
|
+
issues.push(issue_1.Issue.atStatement(file, first, "Implicit START-OF-SELECTION", this.getMetadata().key, this.getConfig().severity));
|
|
63357
|
+
}
|
|
63358
|
+
return issues;
|
|
63359
|
+
}
|
|
63360
|
+
}
|
|
63361
|
+
exports.ImplicitStartOfSelection = ImplicitStartOfSelection;
|
|
63362
|
+
//# sourceMappingURL=implicit_start_of_selection.js.map
|
|
63363
|
+
|
|
63364
|
+
/***/ }),
|
|
63365
|
+
|
|
63053
63366
|
/***/ "./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js":
|
|
63054
63367
|
/*!*********************************************************************************!*\
|
|
63055
63368
|
!*** ./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js ***!
|
|
@@ -63353,6 +63666,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
63353
63666
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
63354
63667
|
__exportStar(__webpack_require__(/*! ./7bit_ascii */ "./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js"), exports);
|
|
63355
63668
|
__exportStar(__webpack_require__(/*! ./abapdoc */ "./node_modules/@abaplint/core/build/src/rules/abapdoc.js"), exports);
|
|
63669
|
+
__exportStar(__webpack_require__(/*! ./add_test_attributes */ "./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js"), exports);
|
|
63356
63670
|
__exportStar(__webpack_require__(/*! ./align_parameters */ "./node_modules/@abaplint/core/build/src/rules/align_parameters.js"), exports);
|
|
63357
63671
|
__exportStar(__webpack_require__(/*! ./align_pseudo_comments */ "./node_modules/@abaplint/core/build/src/rules/align_pseudo_comments.js"), exports);
|
|
63358
63672
|
__exportStar(__webpack_require__(/*! ./align_type_expressions */ "./node_modules/@abaplint/core/build/src/rules/align_type_expressions.js"), exports);
|
|
@@ -63394,6 +63708,7 @@ __exportStar(__webpack_require__(/*! ./double_space */ "./node_modules/@abaplint
|
|
|
63394
63708
|
__exportStar(__webpack_require__(/*! ./downport */ "./node_modules/@abaplint/core/build/src/rules/downport.js"), exports);
|
|
63395
63709
|
__exportStar(__webpack_require__(/*! ./dynpro_checks */ "./node_modules/@abaplint/core/build/src/rules/dynpro_checks.js"), exports);
|
|
63396
63710
|
__exportStar(__webpack_require__(/*! ./easy_to_find_messages */ "./node_modules/@abaplint/core/build/src/rules/easy_to_find_messages.js"), exports);
|
|
63711
|
+
__exportStar(__webpack_require__(/*! ./empty_event */ "./node_modules/@abaplint/core/build/src/rules/empty_event.js"), exports);
|
|
63397
63712
|
__exportStar(__webpack_require__(/*! ./empty_line_in_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js"), exports);
|
|
63398
63713
|
__exportStar(__webpack_require__(/*! ./empty_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_statement.js"), exports);
|
|
63399
63714
|
__exportStar(__webpack_require__(/*! ./empty_structure */ "./node_modules/@abaplint/core/build/src/rules/empty_structure.js"), exports);
|
|
@@ -63415,6 +63730,7 @@ __exportStar(__webpack_require__(/*! ./identical_descriptions */ "./node_modules
|
|
|
63415
63730
|
__exportStar(__webpack_require__(/*! ./identical_form_names */ "./node_modules/@abaplint/core/build/src/rules/identical_form_names.js"), exports);
|
|
63416
63731
|
__exportStar(__webpack_require__(/*! ./if_in_if */ "./node_modules/@abaplint/core/build/src/rules/if_in_if.js"), exports);
|
|
63417
63732
|
__exportStar(__webpack_require__(/*! ./implement_methods */ "./node_modules/@abaplint/core/build/src/rules/implement_methods.js"), exports);
|
|
63733
|
+
__exportStar(__webpack_require__(/*! ./implicit_start_of_selection */ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js"), exports);
|
|
63418
63734
|
__exportStar(__webpack_require__(/*! ./in_statement_indentation */ "./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js"), exports);
|
|
63419
63735
|
__exportStar(__webpack_require__(/*! ./indentation */ "./node_modules/@abaplint/core/build/src/rules/indentation.js"), exports);
|
|
63420
63736
|
__exportStar(__webpack_require__(/*! ./inline_data_old_versions */ "./node_modules/@abaplint/core/build/src/rules/inline_data_old_versions.js"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.113.0",
|
|
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.
|
|
41
|
+
"@abaplint/core": "^2.113.0",
|
|
42
42
|
"@types/chai": "^4.3.19",
|
|
43
43
|
"@types/glob": "^8.1.0",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|