@abaplint/cli 2.112.22 → 2.113.1
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 +376 -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,42 @@ 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.Tables,
|
|
35228
|
+
Statements.Include, // this is not super correct, but anyhow
|
|
35229
|
+
Statements.Parameter,
|
|
35230
|
+
Statements.SelectionScreen,
|
|
35231
|
+
Statements.ConstantBegin,
|
|
35232
|
+
];
|
|
35233
|
+
//# sourceMappingURL=selection_events.js.map
|
|
35234
|
+
|
|
35235
|
+
/***/ }),
|
|
35236
|
+
|
|
35237
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js":
|
|
35238
|
+
/*!***************************************************************************!*\
|
|
35239
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js ***!
|
|
35240
|
+
\***************************************************************************/
|
|
35241
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
35242
|
+
|
|
35243
|
+
"use strict";
|
|
35244
|
+
|
|
35245
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35246
|
+
exports.StatementFlow = void 0;
|
|
35247
|
+
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
35248
|
+
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
35249
|
+
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
35250
|
+
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
35251
|
+
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
35252
|
+
const objects_1 = __webpack_require__(/*! ../../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
35253
|
+
const selection_events_1 = __webpack_require__(/*! ./selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
35241
35254
|
class StatementFlow {
|
|
35242
35255
|
constructor() {
|
|
35243
35256
|
this.counter = 0;
|
|
35244
35257
|
}
|
|
35245
|
-
build(stru) {
|
|
35258
|
+
build(stru, obj) {
|
|
35246
35259
|
var _a, _b, _c, _d;
|
|
35247
35260
|
const ret = [];
|
|
35248
35261
|
let name = "";
|
|
@@ -35268,36 +35281,38 @@ class StatementFlow {
|
|
|
35268
35281
|
throw new Error("StatementFlow, unknown structure");
|
|
35269
35282
|
}
|
|
35270
35283
|
}
|
|
35271
|
-
|
|
35272
|
-
|
|
35273
|
-
|
|
35274
|
-
|
|
35275
|
-
|
|
35276
|
-
if (
|
|
35277
|
-
|
|
35284
|
+
if (obj instanceof objects_1.Program) {
|
|
35285
|
+
// find the top level events
|
|
35286
|
+
let inEvent = false;
|
|
35287
|
+
let collected = [];
|
|
35288
|
+
for (const s of stru.getChildren() || []) {
|
|
35289
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
35290
|
+
if (inEvent === true) {
|
|
35291
|
+
ret.push(this.runEvent(collected, name));
|
|
35292
|
+
}
|
|
35293
|
+
collected = [];
|
|
35294
|
+
inEvent = true;
|
|
35295
|
+
name = s.concatTokens();
|
|
35296
|
+
}
|
|
35297
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
35298
|
+
collected.push(s);
|
|
35299
|
+
}
|
|
35300
|
+
else {
|
|
35301
|
+
if (inEvent === true) {
|
|
35302
|
+
ret.push(this.runEvent(collected, name));
|
|
35303
|
+
inEvent = false;
|
|
35304
|
+
}
|
|
35305
|
+
collected = [];
|
|
35278
35306
|
}
|
|
35279
|
-
collected = [];
|
|
35280
|
-
inFlow = true;
|
|
35281
|
-
name = s.concatTokens();
|
|
35282
35307
|
}
|
|
35283
|
-
|
|
35284
|
-
|
|
35308
|
+
if (inEvent === true) {
|
|
35309
|
+
ret.push(this.runEvent(collected, name));
|
|
35285
35310
|
}
|
|
35286
|
-
else {
|
|
35287
|
-
|
|
35288
|
-
|
|
35289
|
-
inFlow = false;
|
|
35290
|
-
}
|
|
35291
|
-
collected = [];
|
|
35311
|
+
else if (collected.length > 0) {
|
|
35312
|
+
// implicit START-OF-SELECTION
|
|
35313
|
+
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
35292
35314
|
}
|
|
35293
35315
|
}
|
|
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
35316
|
return ret.map(f => f.reduce());
|
|
35302
35317
|
}
|
|
35303
35318
|
////////////////////
|
|
@@ -44004,11 +44019,15 @@ class LanguageServer {
|
|
|
44004
44019
|
if (file === undefined) {
|
|
44005
44020
|
return "file not found";
|
|
44006
44021
|
}
|
|
44022
|
+
const obj = this.reg.findObjectForFile(file);
|
|
44023
|
+
if (obj === undefined) {
|
|
44024
|
+
return "obj not found";
|
|
44025
|
+
}
|
|
44007
44026
|
const stru = file.getStructure();
|
|
44008
44027
|
if (stru === undefined) {
|
|
44009
44028
|
return "empty structure";
|
|
44010
44029
|
}
|
|
44011
|
-
const graphs = new statement_flow_1.StatementFlow().build(stru);
|
|
44030
|
+
const graphs = new statement_flow_1.StatementFlow().build(stru, obj);
|
|
44012
44031
|
const wiz = graphs.map(g => g.toDigraph());
|
|
44013
44032
|
return JSON.stringify(wiz);
|
|
44014
44033
|
}
|
|
@@ -52623,7 +52642,7 @@ class Registry {
|
|
|
52623
52642
|
}
|
|
52624
52643
|
static abaplintVersion() {
|
|
52625
52644
|
// magic, see build script "version.sh"
|
|
52626
|
-
return "2.
|
|
52645
|
+
return "2.113.1";
|
|
52627
52646
|
}
|
|
52628
52647
|
getDDICReferences() {
|
|
52629
52648
|
return this.ddicReferences;
|
|
@@ -53261,6 +53280,111 @@ exports.Abapdoc = Abapdoc;
|
|
|
53261
53280
|
|
|
53262
53281
|
/***/ }),
|
|
53263
53282
|
|
|
53283
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js":
|
|
53284
|
+
/*!****************************************************************************!*\
|
|
53285
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js ***!
|
|
53286
|
+
\****************************************************************************/
|
|
53287
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
53288
|
+
|
|
53289
|
+
"use strict";
|
|
53290
|
+
|
|
53291
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
53292
|
+
exports.AddTestAttributes = exports.AddTestAttributesConf = void 0;
|
|
53293
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
53294
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
53295
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
53296
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
53297
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
53298
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
53299
|
+
class AddTestAttributesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
53300
|
+
}
|
|
53301
|
+
exports.AddTestAttributesConf = AddTestAttributesConf;
|
|
53302
|
+
class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
53303
|
+
constructor() {
|
|
53304
|
+
super(...arguments);
|
|
53305
|
+
this.conf = new AddTestAttributesConf();
|
|
53306
|
+
}
|
|
53307
|
+
getMetadata() {
|
|
53308
|
+
return {
|
|
53309
|
+
key: "add_test_attributes",
|
|
53310
|
+
title: "Add test attributes for tests classes with test methods",
|
|
53311
|
+
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53312
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
53313
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53314
|
+
PUBLIC SECTION.
|
|
53315
|
+
PROTECTED SECTION.
|
|
53316
|
+
PRIVATE SECTION.
|
|
53317
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53318
|
+
ENDCLASS.
|
|
53319
|
+
|
|
53320
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53321
|
+
METHOD test.
|
|
53322
|
+
ENDMETHOD.
|
|
53323
|
+
ENDCLASS.`,
|
|
53324
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53325
|
+
PUBLIC SECTION.
|
|
53326
|
+
PROTECTED SECTION.
|
|
53327
|
+
PRIVATE SECTION.
|
|
53328
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53329
|
+
ENDCLASS.
|
|
53330
|
+
|
|
53331
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53332
|
+
METHOD test.
|
|
53333
|
+
ENDMETHOD.
|
|
53334
|
+
ENDCLASS.`,
|
|
53335
|
+
};
|
|
53336
|
+
}
|
|
53337
|
+
getConfig() {
|
|
53338
|
+
return this.conf;
|
|
53339
|
+
}
|
|
53340
|
+
setConfig(conf) {
|
|
53341
|
+
this.conf = conf;
|
|
53342
|
+
}
|
|
53343
|
+
runParsed(file) {
|
|
53344
|
+
const issues = [];
|
|
53345
|
+
const stru = file.getStructure();
|
|
53346
|
+
if (stru === undefined) {
|
|
53347
|
+
return [];
|
|
53348
|
+
}
|
|
53349
|
+
for (const classStructure of stru.findAllStructures(Structures.ClassDefinition)) {
|
|
53350
|
+
const cdef = classStructure.findFirstStatement(Statements.ClassDefinition);
|
|
53351
|
+
if (cdef === undefined) {
|
|
53352
|
+
continue;
|
|
53353
|
+
}
|
|
53354
|
+
const cdefConcat = cdef === null || cdef === void 0 ? void 0 : cdef.concatTokens().toUpperCase();
|
|
53355
|
+
if ((cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" FOR TESTING")) === false) {
|
|
53356
|
+
continue;
|
|
53357
|
+
}
|
|
53358
|
+
const hasDuration = cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" DURATION ");
|
|
53359
|
+
const hasRiskLevel = cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" RISK LEVEL ");
|
|
53360
|
+
if (hasDuration === true && hasRiskLevel === true) {
|
|
53361
|
+
continue;
|
|
53362
|
+
}
|
|
53363
|
+
let hasTestMethod = false;
|
|
53364
|
+
for (const mdef of classStructure.findAllStatements(Statements.MethodDef)) {
|
|
53365
|
+
const concat = mdef.concatTokens().toUpperCase();
|
|
53366
|
+
if (concat.includes(" FOR TESTING")) {
|
|
53367
|
+
hasTestMethod = true;
|
|
53368
|
+
}
|
|
53369
|
+
}
|
|
53370
|
+
if (hasTestMethod === false) {
|
|
53371
|
+
continue;
|
|
53372
|
+
}
|
|
53373
|
+
if (hasDuration === false) {
|
|
53374
|
+
issues.push(issue_1.Issue.atStatement(file, cdef, "Add DURATION", this.getMetadata().key, this.getConfig().severity));
|
|
53375
|
+
}
|
|
53376
|
+
if (hasRiskLevel === false) {
|
|
53377
|
+
issues.push(issue_1.Issue.atStatement(file, cdef, "Add RISK LEVEL", this.getMetadata().key, this.getConfig().severity));
|
|
53378
|
+
}
|
|
53379
|
+
}
|
|
53380
|
+
return issues;
|
|
53381
|
+
}
|
|
53382
|
+
}
|
|
53383
|
+
exports.AddTestAttributes = AddTestAttributes;
|
|
53384
|
+
//# sourceMappingURL=add_test_attributes.js.map
|
|
53385
|
+
|
|
53386
|
+
/***/ }),
|
|
53387
|
+
|
|
53264
53388
|
/***/ "./node_modules/@abaplint/core/build/src/rules/align_parameters.js":
|
|
53265
53389
|
/*!*************************************************************************!*\
|
|
53266
53390
|
!*** ./node_modules/@abaplint/core/build/src/rules/align_parameters.js ***!
|
|
@@ -60684,6 +60808,100 @@ exports.EasyToFindMessages = EasyToFindMessages;
|
|
|
60684
60808
|
|
|
60685
60809
|
/***/ }),
|
|
60686
60810
|
|
|
60811
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/empty_event.js":
|
|
60812
|
+
/*!********************************************************************!*\
|
|
60813
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/empty_event.js ***!
|
|
60814
|
+
\********************************************************************/
|
|
60815
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
60816
|
+
|
|
60817
|
+
"use strict";
|
|
60818
|
+
|
|
60819
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
60820
|
+
exports.EmptyEvent = exports.EmptyEventConf = void 0;
|
|
60821
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
60822
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
60823
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
60824
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
60825
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
60826
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
60827
|
+
const selection_events_1 = __webpack_require__(/*! ../abap/flow/selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
60828
|
+
class EmptyEventConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
60829
|
+
}
|
|
60830
|
+
exports.EmptyEventConf = EmptyEventConf;
|
|
60831
|
+
class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
60832
|
+
constructor() {
|
|
60833
|
+
super(...arguments);
|
|
60834
|
+
this.conf = new EmptyEventConf();
|
|
60835
|
+
}
|
|
60836
|
+
getMetadata() {
|
|
60837
|
+
return {
|
|
60838
|
+
key: "empty_event",
|
|
60839
|
+
title: "Empty selection screen or list processing event block",
|
|
60840
|
+
shortDescription: `Empty selection screen or list processing event block`,
|
|
60841
|
+
extendedInformation: ``,
|
|
60842
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
60843
|
+
badExample: `
|
|
60844
|
+
INITIALIZATION.
|
|
60845
|
+
WRITE 'hello'.
|
|
60846
|
+
END-OF-SELECTION.`,
|
|
60847
|
+
goodExample: `
|
|
60848
|
+
START-OF-SELECTION.
|
|
60849
|
+
PERFORM sdf.
|
|
60850
|
+
COMMIT WORK.`,
|
|
60851
|
+
};
|
|
60852
|
+
}
|
|
60853
|
+
getConfig() {
|
|
60854
|
+
return this.conf;
|
|
60855
|
+
}
|
|
60856
|
+
setConfig(conf) {
|
|
60857
|
+
this.conf = conf;
|
|
60858
|
+
}
|
|
60859
|
+
runParsed(file, obj) {
|
|
60860
|
+
const issues = [];
|
|
60861
|
+
if (!(obj instanceof objects_1.Program) || obj.isInclude()) {
|
|
60862
|
+
return issues;
|
|
60863
|
+
}
|
|
60864
|
+
const stru = file.getStructure();
|
|
60865
|
+
if (stru === undefined) {
|
|
60866
|
+
return [];
|
|
60867
|
+
}
|
|
60868
|
+
let currentEvent = undefined;
|
|
60869
|
+
let children = [];
|
|
60870
|
+
for (const s of stru.getChildren() || []) {
|
|
60871
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
60872
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
60873
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
60874
|
+
}
|
|
60875
|
+
children = [];
|
|
60876
|
+
currentEvent = s;
|
|
60877
|
+
}
|
|
60878
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
60879
|
+
const stru = s;
|
|
60880
|
+
// ignore declaration stuff
|
|
60881
|
+
if (selection_events_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
60882
|
+
continue;
|
|
60883
|
+
}
|
|
60884
|
+
children.push(s);
|
|
60885
|
+
}
|
|
60886
|
+
else {
|
|
60887
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
60888
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
60889
|
+
}
|
|
60890
|
+
children = [];
|
|
60891
|
+
currentEvent = undefined;
|
|
60892
|
+
}
|
|
60893
|
+
}
|
|
60894
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
60895
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
60896
|
+
}
|
|
60897
|
+
return issues;
|
|
60898
|
+
}
|
|
60899
|
+
}
|
|
60900
|
+
exports.EmptyEvent = EmptyEvent;
|
|
60901
|
+
//# sourceMappingURL=empty_event.js.map
|
|
60902
|
+
|
|
60903
|
+
/***/ }),
|
|
60904
|
+
|
|
60687
60905
|
/***/ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js":
|
|
60688
60906
|
/*!********************************************************************************!*\
|
|
60689
60907
|
!*** ./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js ***!
|
|
@@ -63050,6 +63268,109 @@ exports.ImplementMethods = ImplementMethods;
|
|
|
63050
63268
|
|
|
63051
63269
|
/***/ }),
|
|
63052
63270
|
|
|
63271
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js":
|
|
63272
|
+
/*!************************************************************************************!*\
|
|
63273
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js ***!
|
|
63274
|
+
\************************************************************************************/
|
|
63275
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
63276
|
+
|
|
63277
|
+
"use strict";
|
|
63278
|
+
|
|
63279
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
63280
|
+
exports.ImplicitStartOfSelection = exports.ImplicitStartOfSelectionConf = void 0;
|
|
63281
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
63282
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
63283
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
63284
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
63285
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
63286
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
63287
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
63288
|
+
const selection_events_1 = __webpack_require__(/*! ../abap/flow/selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
63289
|
+
class ImplicitStartOfSelectionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
63290
|
+
}
|
|
63291
|
+
exports.ImplicitStartOfSelectionConf = ImplicitStartOfSelectionConf;
|
|
63292
|
+
class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
63293
|
+
constructor() {
|
|
63294
|
+
super(...arguments);
|
|
63295
|
+
this.conf = new ImplicitStartOfSelectionConf();
|
|
63296
|
+
}
|
|
63297
|
+
getMetadata() {
|
|
63298
|
+
return {
|
|
63299
|
+
key: "implicit_start_of_selection",
|
|
63300
|
+
title: "Implicit START-OF-SELECTION",
|
|
63301
|
+
shortDescription: `Add explicit selection screen event handling`,
|
|
63302
|
+
extendedInformation: `Only runs for executable programs
|
|
63303
|
+
|
|
63304
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63305
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
63306
|
+
badExample: `REPORT zfoo.
|
|
63307
|
+
WRITE 'hello'.`,
|
|
63308
|
+
goodExample: `
|
|
63309
|
+
START-OF-SELECTION.
|
|
63310
|
+
WRITE 'hello'.`,
|
|
63311
|
+
};
|
|
63312
|
+
}
|
|
63313
|
+
getConfig() {
|
|
63314
|
+
return this.conf;
|
|
63315
|
+
}
|
|
63316
|
+
setConfig(conf) {
|
|
63317
|
+
this.conf = conf;
|
|
63318
|
+
}
|
|
63319
|
+
runParsed(file, obj) {
|
|
63320
|
+
const issues = [];
|
|
63321
|
+
if (!(obj instanceof objects_1.Program) || obj.isInclude()) {
|
|
63322
|
+
return issues;
|
|
63323
|
+
}
|
|
63324
|
+
const stru = file.getStructure();
|
|
63325
|
+
if (stru === undefined) {
|
|
63326
|
+
return [];
|
|
63327
|
+
}
|
|
63328
|
+
let inEvent = false;
|
|
63329
|
+
let collected = [];
|
|
63330
|
+
for (const s of stru.getChildren() || []) {
|
|
63331
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
63332
|
+
if (inEvent === false && collected.length > 0) {
|
|
63333
|
+
// implicit START-OF-SELECTION
|
|
63334
|
+
let first = collected[0];
|
|
63335
|
+
if (first instanceof nodes_1.StructureNode) {
|
|
63336
|
+
first = first.getFirstStatement();
|
|
63337
|
+
}
|
|
63338
|
+
issues.push(issue_1.Issue.atStatement(file, first, "Implicit START-OF-SELECTION", this.getMetadata().key, this.getConfig().severity));
|
|
63339
|
+
}
|
|
63340
|
+
collected = [];
|
|
63341
|
+
inEvent = true;
|
|
63342
|
+
}
|
|
63343
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
63344
|
+
const stru = s;
|
|
63345
|
+
// ignore declaration stuff
|
|
63346
|
+
if (selection_events_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
63347
|
+
continue;
|
|
63348
|
+
}
|
|
63349
|
+
collected.push(s);
|
|
63350
|
+
}
|
|
63351
|
+
else {
|
|
63352
|
+
if (inEvent === true) {
|
|
63353
|
+
inEvent = false;
|
|
63354
|
+
}
|
|
63355
|
+
collected = [];
|
|
63356
|
+
}
|
|
63357
|
+
}
|
|
63358
|
+
if (inEvent === false && collected.length > 0) {
|
|
63359
|
+
// implicit START-OF-SELECTION
|
|
63360
|
+
let first = collected[0];
|
|
63361
|
+
if (first instanceof nodes_1.StructureNode) {
|
|
63362
|
+
first = first.getFirstStatement();
|
|
63363
|
+
}
|
|
63364
|
+
issues.push(issue_1.Issue.atStatement(file, first, "Implicit START-OF-SELECTION", this.getMetadata().key, this.getConfig().severity));
|
|
63365
|
+
}
|
|
63366
|
+
return issues;
|
|
63367
|
+
}
|
|
63368
|
+
}
|
|
63369
|
+
exports.ImplicitStartOfSelection = ImplicitStartOfSelection;
|
|
63370
|
+
//# sourceMappingURL=implicit_start_of_selection.js.map
|
|
63371
|
+
|
|
63372
|
+
/***/ }),
|
|
63373
|
+
|
|
63053
63374
|
/***/ "./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js":
|
|
63054
63375
|
/*!*********************************************************************************!*\
|
|
63055
63376
|
!*** ./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js ***!
|
|
@@ -63353,6 +63674,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
63353
63674
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
63354
63675
|
__exportStar(__webpack_require__(/*! ./7bit_ascii */ "./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js"), exports);
|
|
63355
63676
|
__exportStar(__webpack_require__(/*! ./abapdoc */ "./node_modules/@abaplint/core/build/src/rules/abapdoc.js"), exports);
|
|
63677
|
+
__exportStar(__webpack_require__(/*! ./add_test_attributes */ "./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js"), exports);
|
|
63356
63678
|
__exportStar(__webpack_require__(/*! ./align_parameters */ "./node_modules/@abaplint/core/build/src/rules/align_parameters.js"), exports);
|
|
63357
63679
|
__exportStar(__webpack_require__(/*! ./align_pseudo_comments */ "./node_modules/@abaplint/core/build/src/rules/align_pseudo_comments.js"), exports);
|
|
63358
63680
|
__exportStar(__webpack_require__(/*! ./align_type_expressions */ "./node_modules/@abaplint/core/build/src/rules/align_type_expressions.js"), exports);
|
|
@@ -63394,6 +63716,7 @@ __exportStar(__webpack_require__(/*! ./double_space */ "./node_modules/@abaplint
|
|
|
63394
63716
|
__exportStar(__webpack_require__(/*! ./downport */ "./node_modules/@abaplint/core/build/src/rules/downport.js"), exports);
|
|
63395
63717
|
__exportStar(__webpack_require__(/*! ./dynpro_checks */ "./node_modules/@abaplint/core/build/src/rules/dynpro_checks.js"), exports);
|
|
63396
63718
|
__exportStar(__webpack_require__(/*! ./easy_to_find_messages */ "./node_modules/@abaplint/core/build/src/rules/easy_to_find_messages.js"), exports);
|
|
63719
|
+
__exportStar(__webpack_require__(/*! ./empty_event */ "./node_modules/@abaplint/core/build/src/rules/empty_event.js"), exports);
|
|
63397
63720
|
__exportStar(__webpack_require__(/*! ./empty_line_in_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js"), exports);
|
|
63398
63721
|
__exportStar(__webpack_require__(/*! ./empty_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_statement.js"), exports);
|
|
63399
63722
|
__exportStar(__webpack_require__(/*! ./empty_structure */ "./node_modules/@abaplint/core/build/src/rules/empty_structure.js"), exports);
|
|
@@ -63415,6 +63738,7 @@ __exportStar(__webpack_require__(/*! ./identical_descriptions */ "./node_modules
|
|
|
63415
63738
|
__exportStar(__webpack_require__(/*! ./identical_form_names */ "./node_modules/@abaplint/core/build/src/rules/identical_form_names.js"), exports);
|
|
63416
63739
|
__exportStar(__webpack_require__(/*! ./if_in_if */ "./node_modules/@abaplint/core/build/src/rules/if_in_if.js"), exports);
|
|
63417
63740
|
__exportStar(__webpack_require__(/*! ./implement_methods */ "./node_modules/@abaplint/core/build/src/rules/implement_methods.js"), exports);
|
|
63741
|
+
__exportStar(__webpack_require__(/*! ./implicit_start_of_selection */ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js"), exports);
|
|
63418
63742
|
__exportStar(__webpack_require__(/*! ./in_statement_indentation */ "./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js"), exports);
|
|
63419
63743
|
__exportStar(__webpack_require__(/*! ./indentation */ "./node_modules/@abaplint/core/build/src/rules/indentation.js"), exports);
|
|
63420
63744
|
__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.1",
|
|
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.1",
|
|
42
42
|
"@types/chai": "^4.3.19",
|
|
43
43
|
"@types/glob": "^8.1.0",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|