@abaplint/core 2.85.39 → 2.85.42
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/README.md +6 -6
- package/build/abaplint.d.ts +10 -0
- package/build/src/abap/2_statements/combi.js +44 -10
- package/build/src/abap/2_statements/statements/index.js +1 -0
- package/build/src/abap/2_statements/statements/loop.js +1 -1
- package/build/src/abap/2_statements/statements/loop_at_screen.js +14 -0
- package/build/src/abap/3_structures/structures/constants.js +1 -1
- package/build/src/abap/3_structures/structures/index.js +1 -0
- package/build/src/abap/3_structures/structures/loop_at_screen.js +13 -0
- package/build/src/abap/3_structures/structures/normal.js +1 -1
- package/build/src/abap/5_syntax/statements/loop_at_screen.js +21 -0
- package/build/src/abap/5_syntax/syntax.js +2 -0
- package/build/src/abap/flow/flow_graph.js +7 -7
- package/build/src/lsp/help.js +7 -7
- package/build/src/pretty_printer/indent.js +1 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/7bit_ascii.js +2 -2
- package/build/src/rules/abapdoc.js +1 -1
- package/build/src/rules/align_parameters.js +33 -33
- package/build/src/rules/ambiguous_statement.js +5 -5
- package/build/src/rules/avoid_use.js +6 -6
- package/build/src/rules/begin_end_names.js +4 -4
- package/build/src/rules/begin_single_include.js +12 -12
- package/build/src/rules/call_transaction_authority_check.js +3 -3
- package/build/src/rules/chain_mainly_declarations.js +4 -4
- package/build/src/rules/check_abstract.js +2 -2
- package/build/src/rules/check_comments.js +4 -4
- package/build/src/rules/check_include.js +3 -3
- package/build/src/rules/check_no_handler_pragma.js +8 -8
- package/build/src/rules/check_subrc.js +8 -8
- package/build/src/rules/commented_code.js +1 -1
- package/build/src/rules/constructor_visibility_public.js +4 -4
- package/build/src/rules/contains_tab.js +2 -2
- package/build/src/rules/dangerous_statement.js +1 -1
- package/build/src/rules/downport.js +60 -51
- package/build/src/rules/exit_or_check.js +3 -3
- package/build/src/rules/exporting.js +1 -1
- package/build/src/rules/forbidden_identifier.js +1 -1
- package/build/src/rules/forbidden_void_type.js +2 -2
- package/build/src/rules/functional_writing.js +17 -17
- package/build/src/rules/global_class.js +10 -10
- package/build/src/rules/identical_conditions.js +2 -2
- package/build/src/rules/identical_contents.js +14 -14
- package/build/src/rules/identical_descriptions.js +4 -4
- package/build/src/rules/if_in_if.js +7 -7
- package/build/src/rules/implement_methods.js +3 -3
- package/build/src/rules/in_statement_indentation.js +11 -11
- package/build/src/rules/intf_referencing_clas.js +3 -3
- package/build/src/rules/line_break_style.js +2 -2
- package/build/src/rules/line_length.js +1 -1
- package/build/src/rules/line_only_punc.js +1 -1
- package/build/src/rules/local_variable_names.js +2 -2
- package/build/src/rules/many_parentheses.js +10 -10
- package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
- package/build/src/rules/max_one_statement.js +3 -3
- package/build/src/rules/nesting.js +1 -1
- package/build/src/rules/no_chained_assignment.js +1 -1
- package/build/src/rules/no_public_attributes.js +7 -1
- package/build/src/rules/no_yoda_conditions.js +4 -4
- package/build/src/rules/obsolete_statement.js +40 -40
- package/build/src/rules/omit_parameter_name.js +3 -3
- package/build/src/rules/omit_receiving.js +13 -13
- package/build/src/rules/parser_702_chaining.js +2 -2
- package/build/src/rules/parser_error.js +2 -2
- package/build/src/rules/parser_missing_space.js +1 -1
- package/build/src/rules/prefer_inline.js +16 -16
- package/build/src/rules/prefer_is_not.js +7 -7
- package/build/src/rules/prefer_raise_exception_new.js +3 -3
- package/build/src/rules/prefer_returning_to_exporting.js +1 -1
- package/build/src/rules/prefer_xsdbool.js +2 -2
- package/build/src/rules/remove_descriptions.js +4 -4
- package/build/src/rules/rfc_error_handling.js +9 -9
- package/build/src/rules/select_add_order_by.js +6 -6
- package/build/src/rules/select_performance.js +2 -2
- package/build/src/rules/sicf_consistency.js +4 -4
- package/build/src/rules/space_before_dot.js +2 -2
- package/build/src/rules/start_at_tab.js +1 -1
- package/build/src/rules/sy_modification.js +2 -2
- package/build/src/rules/tabl_enhancement_category.js +2 -2
- package/build/src/rules/unused_methods.js +9 -9
- package/build/src/rules/unused_variables.js +6 -6
- package/build/src/rules/use_bool_expression.js +8 -8
- package/build/src/rules/use_line_exists.js +6 -6
- package/build/src/rules/use_new.js +4 -4
- package/build/src/rules/when_others_last.js +6 -6
- package/build/src/utils/include_graph.js +10 -0
- package/package.json +66 -66
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# @abaplint/core
|
|
2
|
-
|
|
3
|
-
[abaplint](https://abaplint.org/) core library
|
|
4
|
-
|
|
5
|
-
Exposes functionality like the parser and rules, which can be used in other projects.
|
|
6
|
-
|
|
1
|
+
# @abaplint/core
|
|
2
|
+
|
|
3
|
+
[abaplint](https://abaplint.org/) core library
|
|
4
|
+
|
|
5
|
+
Exposes functionality like the parser and rules, which can be used in other projects.
|
|
6
|
+
|
|
7
7
|
For more information see https://github.com/abaplint/abaplint
|
package/build/abaplint.d.ts
CHANGED
|
@@ -3502,6 +3502,14 @@ declare class Loop_2 implements IStatement {
|
|
|
3502
3502
|
getMatcher(): IStatementRunnable;
|
|
3503
3503
|
}
|
|
3504
3504
|
|
|
3505
|
+
declare class LoopAtScreen implements IStructure {
|
|
3506
|
+
getMatcher(): IStructureRunnable;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
declare class LoopAtScreen_2 implements IStatement {
|
|
3510
|
+
getMatcher(): IStatementRunnable;
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3505
3513
|
declare class LoopGroupBy extends Expression {
|
|
3506
3514
|
getRunnable(): IStatementRunnable;
|
|
3507
3515
|
}
|
|
@@ -5026,6 +5034,7 @@ declare namespace Statements {
|
|
|
5026
5034
|
BreakId,
|
|
5027
5035
|
InterfaceDeferred,
|
|
5028
5036
|
While_2 as While,
|
|
5037
|
+
LoopAtScreen_2 as LoopAtScreen,
|
|
5029
5038
|
Loop_2 as Loop,
|
|
5030
5039
|
Check,
|
|
5031
5040
|
EndProvide,
|
|
@@ -5425,6 +5434,7 @@ declare namespace Structures {
|
|
|
5425
5434
|
If,
|
|
5426
5435
|
InterfaceGlobal,
|
|
5427
5436
|
Interface_2 as Interface,
|
|
5437
|
+
LoopAtScreen,
|
|
5428
5438
|
Loop,
|
|
5429
5439
|
Method,
|
|
5430
5440
|
Module,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
|
|
3
|
+
exports.fail = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
|
|
4
4
|
const Tokens = require("../1_lexer/tokens");
|
|
5
5
|
const nodes_1 = require("../nodes");
|
|
6
6
|
const version_1 = require("../../version");
|
|
@@ -572,6 +572,28 @@ class Permutation {
|
|
|
572
572
|
return [""];
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
+
class FailCombinator extends Error {
|
|
576
|
+
}
|
|
577
|
+
class Fail {
|
|
578
|
+
listKeywords() {
|
|
579
|
+
return [];
|
|
580
|
+
}
|
|
581
|
+
getUsing() {
|
|
582
|
+
return [];
|
|
583
|
+
}
|
|
584
|
+
run(_r) {
|
|
585
|
+
throw new FailCombinator();
|
|
586
|
+
}
|
|
587
|
+
railroad() {
|
|
588
|
+
return "Railroad.Terminal('!Fail')";
|
|
589
|
+
}
|
|
590
|
+
toStr() {
|
|
591
|
+
return "fail()";
|
|
592
|
+
}
|
|
593
|
+
first() {
|
|
594
|
+
return [];
|
|
595
|
+
}
|
|
596
|
+
}
|
|
575
597
|
class Alternative {
|
|
576
598
|
constructor(list) {
|
|
577
599
|
if (list.length < 2) {
|
|
@@ -711,18 +733,26 @@ class Combi {
|
|
|
711
733
|
static run(runnable, tokens, version) {
|
|
712
734
|
this.ver = version;
|
|
713
735
|
const input = new result_1.Result(tokens, 0);
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
736
|
+
try {
|
|
737
|
+
const result = runnable.run([input]);
|
|
738
|
+
/*
|
|
739
|
+
console.log("res: " + result.length);
|
|
740
|
+
for (const res of result) {
|
|
741
|
+
console.dir(res.getNodes().map(n => n.get().constructor.name));
|
|
742
|
+
console.dir(res.getNodes().map(n => n.concatTokens()));
|
|
743
|
+
}
|
|
744
|
+
*/
|
|
717
745
|
for (const res of result) {
|
|
718
|
-
|
|
719
|
-
|
|
746
|
+
if (res.remainingLength() === 0) {
|
|
747
|
+
return res.getNodes();
|
|
748
|
+
}
|
|
720
749
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
if (
|
|
724
|
-
return
|
|
750
|
+
}
|
|
751
|
+
catch (err) {
|
|
752
|
+
if (err instanceof FailCombinator) {
|
|
753
|
+
return undefined;
|
|
725
754
|
}
|
|
755
|
+
throw err;
|
|
726
756
|
}
|
|
727
757
|
return undefined;
|
|
728
758
|
}
|
|
@@ -824,4 +854,8 @@ function verNot(version, first) {
|
|
|
824
854
|
return new VersNot(version, map(first));
|
|
825
855
|
}
|
|
826
856
|
exports.verNot = verNot;
|
|
857
|
+
function fail() {
|
|
858
|
+
return new Fail();
|
|
859
|
+
}
|
|
860
|
+
exports.fail = fail;
|
|
827
861
|
//# sourceMappingURL=combi.js.map
|
|
@@ -36,6 +36,7 @@ __exportStar(require("./do"), exports);
|
|
|
36
36
|
__exportStar(require("./break_id"), exports);
|
|
37
37
|
__exportStar(require("./interface_deferred"), exports);
|
|
38
38
|
__exportStar(require("./while"), exports);
|
|
39
|
+
__exportStar(require("./loop_at_screen"), exports);
|
|
39
40
|
__exportStar(require("./loop"), exports);
|
|
40
41
|
__exportStar(require("./check"), exports);
|
|
41
42
|
__exportStar(require("./endprovide"), exports);
|
|
@@ -17,7 +17,7 @@ class Loop {
|
|
|
17
17
|
const to = (0, combi_1.seq)("TO", expressions_1.Source);
|
|
18
18
|
const usingKey = (0, combi_1.seq)("USING KEY", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));
|
|
19
19
|
const options = (0, combi_1.per)(target, from, to, where, usingKey, group);
|
|
20
|
-
const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
|
|
20
|
+
const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.seq)("SCREEN", (0, combi_1.fail)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
|
|
21
21
|
return (0, combi_1.seq)("LOOP", (0, combi_1.opt)(at));
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoopAtScreen = void 0;
|
|
4
|
+
const combi_1 = require("../combi");
|
|
5
|
+
const version_1 = require("../../../version");
|
|
6
|
+
const expressions_1 = require("../expressions");
|
|
7
|
+
class LoopAtScreen {
|
|
8
|
+
getMatcher() {
|
|
9
|
+
const l = (0, combi_1.seq)("LOOP AT SCREEN", (0, combi_1.opt)((0, combi_1.seq)("INTO", expressions_1.Target)));
|
|
10
|
+
return (0, combi_1.verNot)(version_1.Version.Cloud, l);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.LoopAtScreen = LoopAtScreen;
|
|
14
|
+
//# sourceMappingURL=loop_at_screen.js.map
|
|
@@ -5,7 +5,7 @@ const Statements = require("../../2_statements/statements");
|
|
|
5
5
|
const _combi_1 = require("./_combi");
|
|
6
6
|
class Constants {
|
|
7
7
|
getMatcher() {
|
|
8
|
-
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.ConstantBegin), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sub)(Constants))), (0, _combi_1.sta)(Statements.ConstantEnd));
|
|
8
|
+
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.ConstantBegin), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Include), (0, _combi_1.sub)(Constants))), (0, _combi_1.sta)(Statements.ConstantEnd));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.Constants = Constants;
|
|
@@ -41,6 +41,7 @@ __exportStar(require("./function_module"), exports);
|
|
|
41
41
|
__exportStar(require("./if"), exports);
|
|
42
42
|
__exportStar(require("./interface_global"), exports);
|
|
43
43
|
__exportStar(require("./interface"), exports);
|
|
44
|
+
__exportStar(require("./loop_at_screen"), exports);
|
|
44
45
|
__exportStar(require("./loop"), exports);
|
|
45
46
|
__exportStar(require("./method"), exports);
|
|
46
47
|
__exportStar(require("./module"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoopAtScreen = void 0;
|
|
4
|
+
const Statements = require("../../2_statements/statements");
|
|
5
|
+
const _combi_1 = require("./_combi");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
class LoopAtScreen {
|
|
8
|
+
getMatcher() {
|
|
9
|
+
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.LoopAtScreen), (0, _combi_1.opt)((0, _combi_1.sub)(_1.Body)), (0, _combi_1.sta)(Statements.EndLoop));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.LoopAtScreen = LoopAtScreen;
|
|
13
|
+
//# sourceMappingURL=loop_at_screen.js.map
|
|
@@ -8,7 +8,7 @@ const _statement_1 = require("../../2_statements/statements/_statement");
|
|
|
8
8
|
class Normal {
|
|
9
9
|
getMatcher() {
|
|
10
10
|
// note that the sequence of alternatives here influences performance
|
|
11
|
-
return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level
|
|
11
|
+
return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.LoopAtScreen), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level
|
|
12
12
|
(0, _combi_1.sta)(Statements.InsertDatabase), (0, _combi_1.sta)(Statements.InsertReport), (0, _combi_1.sta)(Statements.InsertTextpool), (0, _combi_1.sta)(Statements.InsertFieldGroup), (0, _combi_1.sta)(Statements.InterfaceLoad), (0, _combi_1.sta)(Statements.Leave), (0, _combi_1.sta)(Statements.LoadReport), (0, _combi_1.sta)(Statements.Local), (0, _combi_1.sta)(Statements.With), (0, _combi_1.sta)(Statements.LogPoint), (0, _combi_1.sta)(Statements.Message), (0, _combi_1.sta)(Statements.ModifyLine), (0, _combi_1.sta)(Statements.ModifyDatabase), (0, _combi_1.sta)(Statements.ModifyInternal), (0, _combi_1.sta)(Statements.Multiply), (0, _combi_1.sta)(Statements.NewLine), (0, _combi_1.sta)(Statements.NewPage), (0, _combi_1.sta)(Statements.OpenCursor), (0, _combi_1.sta)(Statements.OpenDataset), (0, _combi_1.sta)(Statements.Overlay), (0, _combi_1.sta)(Statements.Pack), (0, _combi_1.sta)(Statements.Perform), (0, _combi_1.sta)(Statements.Position), (0, _combi_1.sta)(Statements.Put), (0, _combi_1.sta)(Statements.PrintControl), (0, _combi_1.sta)(Statements.RaiseEvent), (0, _combi_1.sta)(Statements.Raise), (0, _combi_1.sta)(Statements.Ranges), (0, _combi_1.sta)(Statements.ReadDataset), (0, _combi_1.sta)(Statements.ReadLine), (0, _combi_1.sta)(Statements.ReadReport), (0, _combi_1.sta)(Statements.ReadTextpool), (0, _combi_1.sta)(Statements.Receive), (0, _combi_1.sta)(Statements.RefreshControl), (0, _combi_1.sta)(Statements.Refresh), (0, _combi_1.sta)(Statements.Reject), (0, _combi_1.sta)(Statements.Replace), (0, _combi_1.sta)(Statements.Reserve), (0, _combi_1.sta)(Statements.Resume), (0, _combi_1.sta)(Statements.Retry), (0, _combi_1.sta)(Statements.Rollback), (0, _combi_1.sta)(Statements.Scan), (0, _combi_1.sta)(Statements.ScrollList), (0, _combi_1.sta)(Statements.Search), (0, _combi_1.sta)(Statements.SetBit), (0, _combi_1.sta)(Statements.SetBlank), (0, _combi_1.sta)(Statements.SetCountry), (0, _combi_1.sta)(Statements.SetCursor), (0, _combi_1.sta)(Statements.SetDataset), (0, _combi_1.sta)(Statements.SetExtendedCheck), (0, _combi_1.sta)(Statements.SetHandler), (0, _combi_1.sta)(Statements.SetLanguage), (0, _combi_1.sta)(Statements.SetLeft), (0, _combi_1.sta)(Statements.SetLocale), (0, _combi_1.sta)(Statements.SetMargin), (0, _combi_1.sta)(Statements.SetParameter), (0, _combi_1.sta)(Statements.SetPFStatus), (0, _combi_1.sta)(Statements.SetProperty), (0, _combi_1.sta)(Statements.SetRunTime), (0, _combi_1.sta)(Statements.SetScreen), (0, _combi_1.sta)(Statements.SetTitlebar), (0, _combi_1.sta)(Statements.SetUserCommand), (0, _combi_1.sta)(Statements.SetUpdateTask), (0, _combi_1.sta)(Statements.Shift), (0, _combi_1.sta)(Statements.Skip), (0, _combi_1.sta)(Statements.SortDataset), (0, _combi_1.sta)(Statements.Sort), (0, _combi_1.sta)(Statements.Static), (0, _combi_1.sta)(Statements.Split), (0, _combi_1.sta)(Statements.Stop), (0, _combi_1.sta)(Statements.Submit), (0, _combi_1.sta)(Statements.Summary), (0, _combi_1.sta)(Statements.SubtractCorresponding), (0, _combi_1.sta)(Statements.Subtract), (0, _combi_1.sta)(Statements.SuppressDialog), (0, _combi_1.sta)(Statements.Supply), (0, _combi_1.sta)(Statements.Sum), (0, _combi_1.sta)(Statements.SyntaxCheck), (0, _combi_1.sta)(Statements.SystemCall), (0, _combi_1.sta)(Statements.Tables), (0, _combi_1.sta)(Statements.Transfer), (0, _combi_1.sta)(Statements.Translate), (0, _combi_1.sta)(Statements.Type), (0, _combi_1.sta)(Statements.TypePools), (0, _combi_1.sta)(Statements.Uline), (0, _combi_1.sta)(Statements.Unassign), (0, _combi_1.sta)(Statements.Unpack), (0, _combi_1.sta)(Statements.UpdateDatabase), (0, _combi_1.sta)(Statements.Wait), (0, _combi_1.sta)(Statements.Window), (0, _combi_1.sta)(Statements.Write), (0, _combi_1.sta)(Statements.CommitEntities), (0, _combi_1.sta)(Statements.ModifyEntities), (0, _combi_1.sta)(Statements.ReadEntities), (0, _combi_1.sta)(Statements.RollbackEntities), (0, _combi_1.sub)(Structures.Define), (0, _combi_1.sub)(Structures.TestInjection), (0, _combi_1.sub)(Structures.TestSeam), (0, _combi_1.sub)(Structures.TypeMesh), (0, _combi_1.sub)(Structures.Provide), (0, _combi_1.sub)(Structures.CatchSystemExceptions), (0, _combi_1.sub)(Structures.At), (0, _combi_1.sub)(Structures.Constants), (0, _combi_1.sub)(Structures.Types), (0, _combi_1.sub)(Structures.Statics), (0, _combi_1.sub)(Structures.Select), (0, _combi_1.sub)(Structures.Data), (0, _combi_1.sub)(Structures.TypeEnum), (0, _combi_1.sub)(Structures.While), (0, _combi_1.sub)(Structures.With), (0, _combi_1.sub)(Structures.Do), (0, _combi_1.sub)(Structures.ExecSQL));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoopAtScreen = void 0;
|
|
4
|
+
const Expressions = require("../../2_statements/expressions");
|
|
5
|
+
const target_1 = require("../expressions/target");
|
|
6
|
+
const inline_data_1 = require("../expressions/inline_data");
|
|
7
|
+
const basic_1 = require("../../types/basic");
|
|
8
|
+
class LoopAtScreen {
|
|
9
|
+
runSyntax(node, scope, filename) {
|
|
10
|
+
const target = node.findDirectExpression(Expressions.Target);
|
|
11
|
+
if (target) {
|
|
12
|
+
new target_1.Target().runSyntax(target, scope, filename);
|
|
13
|
+
}
|
|
14
|
+
const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
|
|
15
|
+
if (inline) {
|
|
16
|
+
new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("SCREEN"));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.LoopAtScreen = LoopAtScreen;
|
|
21
|
+
//# sourceMappingURL=loop_at_screen.js.map
|
|
@@ -130,6 +130,7 @@ const delete_cluster_1 = require("./statements/delete_cluster");
|
|
|
130
130
|
const unassign_1 = require("./statements/unassign");
|
|
131
131
|
const insert_textpool_1 = require("./statements/insert_textpool");
|
|
132
132
|
const get_cursor_1 = require("./statements/get_cursor");
|
|
133
|
+
const loop_at_screen_1 = require("./statements/loop_at_screen");
|
|
133
134
|
// -----------------------------------
|
|
134
135
|
const map = {};
|
|
135
136
|
function addToMap(handler) {
|
|
@@ -155,6 +156,7 @@ if (Object.keys(map).length === 0) {
|
|
|
155
156
|
addToMap(new assert_1.Assert());
|
|
156
157
|
addToMap(new catch_1.Catch());
|
|
157
158
|
addToMap(new loop_1.Loop());
|
|
159
|
+
addToMap(new loop_at_screen_1.LoopAtScreen());
|
|
158
160
|
addToMap(new set_pf_status_1.SetPFStatus());
|
|
159
161
|
addToMap(new set_titlebar_1.SetTitlebar());
|
|
160
162
|
addToMap(new submit_1.Submit());
|
|
@@ -72,13 +72,13 @@ class FlowGraph {
|
|
|
72
72
|
this.label = label;
|
|
73
73
|
}
|
|
74
74
|
toDigraph() {
|
|
75
|
-
return `digraph G {
|
|
76
|
-
labelloc="t";
|
|
77
|
-
label="${this.label}";
|
|
78
|
-
graph [fontname = "helvetica"];
|
|
79
|
-
node [fontname = "helvetica", shape="box"];
|
|
80
|
-
edge [fontname = "helvetica"];
|
|
81
|
-
${this.toTextEdges()}
|
|
75
|
+
return `digraph G {
|
|
76
|
+
labelloc="t";
|
|
77
|
+
label="${this.label}";
|
|
78
|
+
graph [fontname = "helvetica"];
|
|
79
|
+
node [fontname = "helvetica", shape="box"];
|
|
80
|
+
edge [fontname = "helvetica"];
|
|
81
|
+
${this.toTextEdges()}
|
|
82
82
|
}`;
|
|
83
83
|
}
|
|
84
84
|
listSources(node) {
|
package/build/src/lsp/help.js
CHANGED
|
@@ -19,13 +19,13 @@ class Help {
|
|
|
19
19
|
/////////////////////////////////////////////////
|
|
20
20
|
static dumpABAP(file, reg, textDocument, position) {
|
|
21
21
|
let content = "";
|
|
22
|
-
content = `
|
|
23
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
24
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
25
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
26
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
27
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
28
|
-
<hr>
|
|
22
|
+
content = `
|
|
23
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
24
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
25
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
26
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
27
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
28
|
+
<hr>
|
|
29
29
|
` +
|
|
30
30
|
"<tt>" + textDocument.uri + " (" +
|
|
31
31
|
(position.line + 1) + ", " +
|
|
@@ -139,6 +139,7 @@ class Indent {
|
|
|
139
139
|
|| type instanceof Statements.WhenOthers
|
|
140
140
|
|| type instanceof Statements.Cleanup
|
|
141
141
|
|| type instanceof Statements.Loop
|
|
142
|
+
|| type instanceof Statements.LoopAtScreen
|
|
142
143
|
|| type instanceof Statements.CatchSystemExceptions
|
|
143
144
|
|| type instanceof Statements.Form
|
|
144
145
|
|| type instanceof Statements.Else
|
package/build/src/registry.js
CHANGED
|
@@ -17,8 +17,8 @@ class SevenBitAscii {
|
|
|
17
17
|
key: "7bit_ascii",
|
|
18
18
|
title: "Check for 7bit ascii",
|
|
19
19
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
20
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
21
|
-
|
|
20
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
21
|
+
|
|
22
22
|
Checkes files with extension ".abap" and ".asddls"`,
|
|
23
23
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
24
|
};
|
|
@@ -23,7 +23,7 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
23
23
|
return {
|
|
24
24
|
key: "abapdoc",
|
|
25
25
|
title: "Check abapdoc",
|
|
26
|
-
shortDescription: `Various checks regarding abapdoc.
|
|
26
|
+
shortDescription: `Various checks regarding abapdoc.
|
|
27
27
|
Base rule checks for existence of abapdoc for public class methods and all interface methods.`,
|
|
28
28
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
29
29
|
};
|
|
@@ -20,42 +20,42 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
20
20
|
key: "align_parameters",
|
|
21
21
|
title: "Align Parameters",
|
|
22
22
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
23
|
-
extendedInformation: `Checks:
|
|
24
|
-
* function module calls
|
|
25
|
-
* method calls
|
|
26
|
-
* VALUE constructors
|
|
27
|
-
* NEW constructors
|
|
28
|
-
* RAISE EXCEPTION statements
|
|
29
|
-
* CREATE OBJECT statements
|
|
30
|
-
* RAISE EVENT statements
|
|
31
|
-
|
|
32
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
33
|
-
|
|
34
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
35
|
-
|
|
23
|
+
extendedInformation: `Checks:
|
|
24
|
+
* function module calls
|
|
25
|
+
* method calls
|
|
26
|
+
* VALUE constructors
|
|
27
|
+
* NEW constructors
|
|
28
|
+
* RAISE EXCEPTION statements
|
|
29
|
+
* CREATE OBJECT statements
|
|
30
|
+
* RAISE EVENT statements
|
|
31
|
+
|
|
32
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
33
|
+
|
|
34
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
35
|
+
|
|
36
36
|
Also https://rules.abaplint.org/max_one_method_parameter_per_line/ can help aligning parameter syntax`,
|
|
37
37
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],
|
|
38
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
39
|
-
EXPORTING
|
|
40
|
-
foo = 2
|
|
41
|
-
parameter = 3.
|
|
42
|
-
|
|
43
|
-
foobar( moo = 1
|
|
44
|
-
param = 1 ).
|
|
45
|
-
|
|
46
|
-
foo = VALUE #(
|
|
47
|
-
foo = bar
|
|
38
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
39
|
+
EXPORTING
|
|
40
|
+
foo = 2
|
|
41
|
+
parameter = 3.
|
|
42
|
+
|
|
43
|
+
foobar( moo = 1
|
|
44
|
+
param = 1 ).
|
|
45
|
+
|
|
46
|
+
foo = VALUE #(
|
|
47
|
+
foo = bar
|
|
48
48
|
moo = 2 ).`,
|
|
49
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
50
|
-
EXPORTING
|
|
51
|
-
foo = 2
|
|
52
|
-
parameter = 3.
|
|
53
|
-
|
|
54
|
-
foobar( moo = 1
|
|
55
|
-
param = 1 ).
|
|
56
|
-
|
|
57
|
-
foo = VALUE #(
|
|
58
|
-
foo = bar
|
|
49
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
50
|
+
EXPORTING
|
|
51
|
+
foo = 2
|
|
52
|
+
parameter = 3.
|
|
53
|
+
|
|
54
|
+
foobar( moo = 1
|
|
55
|
+
param = 1 ).
|
|
56
|
+
|
|
57
|
+
foo = VALUE #(
|
|
58
|
+
foo = bar
|
|
59
59
|
moo = 2 ).`,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
@@ -20,14 +20,14 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
20
20
|
return {
|
|
21
21
|
key: "ambiguous_statement",
|
|
22
22
|
title: "Check for ambigious statements",
|
|
23
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
24
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
25
|
-
|
|
23
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
24
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
25
|
+
|
|
26
26
|
Only works if the target version is 740sp05 or above`,
|
|
27
27
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
28
|
-
badExample: `DELETE foo FROM bar.
|
|
28
|
+
badExample: `DELETE foo FROM bar.
|
|
29
29
|
MODIFY foo FROM bar.`,
|
|
30
|
-
goodExample: `DELETE foo FROM @bar.
|
|
30
|
+
goodExample: `DELETE foo FROM @bar.
|
|
31
31
|
MODIFY TABLE foo FROM bar.`,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -35,12 +35,12 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
35
35
|
key: "avoid_use",
|
|
36
36
|
title: "Avoid use of certain statements",
|
|
37
37
|
shortDescription: `Detects usage of certain statements.`,
|
|
38
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
39
|
-
|
|
40
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
41
|
-
|
|
42
|
-
STATICS: use CLASS-DATA instead
|
|
43
|
-
|
|
38
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
39
|
+
|
|
40
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
41
|
+
|
|
42
|
+
STATICS: use CLASS-DATA instead
|
|
43
|
+
|
|
44
44
|
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)`,
|
|
45
45
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
46
46
|
};
|
|
@@ -23,11 +23,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
23
23
|
title: "Check BEGIN END names",
|
|
24
24
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
25
25
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
26
|
-
badExample: `DATA: BEGIN OF stru,
|
|
27
|
-
field TYPE i,
|
|
26
|
+
badExample: `DATA: BEGIN OF stru,
|
|
27
|
+
field TYPE i,
|
|
28
28
|
END OF structure_not_the_same.`,
|
|
29
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
30
|
-
field TYPE i,
|
|
29
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
30
|
+
field TYPE i,
|
|
31
31
|
END OF stru.`,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -21,19 +21,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
title: "BEGIN contains single INCLUDE",
|
|
22
22
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
23
23
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
25
|
-
INCLUDE TYPE dselc.
|
|
26
|
-
TYPES: END OF dummy1.
|
|
27
|
-
|
|
28
|
-
DATA BEGIN OF foo.
|
|
29
|
-
INCLUDE STRUCTURE syst.
|
|
30
|
-
DATA END OF foo.
|
|
31
|
-
|
|
32
|
-
STATICS BEGIN OF bar.
|
|
33
|
-
INCLUDE STRUCTURE syst.
|
|
24
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
25
|
+
INCLUDE TYPE dselc.
|
|
26
|
+
TYPES: END OF dummy1.
|
|
27
|
+
|
|
28
|
+
DATA BEGIN OF foo.
|
|
29
|
+
INCLUDE STRUCTURE syst.
|
|
30
|
+
DATA END OF foo.
|
|
31
|
+
|
|
32
|
+
STATICS BEGIN OF bar.
|
|
33
|
+
INCLUDE STRUCTURE syst.
|
|
34
34
|
STATICS END OF bar.`,
|
|
35
|
-
goodExample: `DATA BEGIN OF foo.
|
|
36
|
-
INCLUDE STRUCTURE dselc.
|
|
35
|
+
goodExample: `DATA BEGIN OF foo.
|
|
36
|
+
INCLUDE STRUCTURE dselc.
|
|
37
37
|
DATA END OF foo.`,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
@@ -24,9 +24,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
24
24
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
25
25
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
26
26
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
27
|
-
goodExample: `TRY.
|
|
28
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
29
|
-
CATCH cx_sy_authorization_error.
|
|
27
|
+
goodExample: `TRY.
|
|
28
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
29
|
+
CATCH cx_sy_authorization_error.
|
|
30
30
|
ENDTRY.`,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
@@ -45,10 +45,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
45
45
|
key: "chain_mainly_declarations",
|
|
46
46
|
title: "Chain mainly declarations",
|
|
47
47
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
48
|
-
extendedInformation: `
|
|
49
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
50
|
-
|
|
51
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
48
|
+
extendedInformation: `
|
|
49
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
50
|
+
|
|
51
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
52
52
|
`,
|
|
53
53
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54
54
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -23,8 +23,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
23
23
|
return {
|
|
24
24
|
key: "check_abstract",
|
|
25
25
|
title: "Check abstract methods and classes",
|
|
26
|
-
shortDescription: `Checks abstract methods and classes:
|
|
27
|
-
- class defined as abstract and final,
|
|
26
|
+
shortDescription: `Checks abstract methods and classes:
|
|
27
|
+
- class defined as abstract and final,
|
|
28
28
|
- non-abstract class contains abstract methods`,
|
|
29
29
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
30
30
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -27,11 +27,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
27
27
|
return {
|
|
28
28
|
key: "check_comments",
|
|
29
29
|
title: "Check Comments",
|
|
30
|
-
shortDescription: `
|
|
30
|
+
shortDescription: `
|
|
31
31
|
Various checks for comment usage.`,
|
|
32
|
-
extendedInformation: `
|
|
33
|
-
* End of line comments. Comments starting with "#EC" or "##" are ignored
|
|
34
|
-
|
|
32
|
+
extendedInformation: `
|
|
33
|
+
* End of line comments. Comments starting with "#EC" or "##" are ignored
|
|
34
|
+
|
|
35
35
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
36
36
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
37
37
|
};
|
|
@@ -17,9 +17,9 @@ class CheckInclude {
|
|
|
17
17
|
key: "check_include",
|
|
18
18
|
title: "Check INCLUDEs",
|
|
19
19
|
shortDescription: `Checks INCLUDE statements`,
|
|
20
|
-
extendedInformation: `
|
|
21
|
-
* Reports unused includes
|
|
22
|
-
* Errors if the includes are not found
|
|
20
|
+
extendedInformation: `
|
|
21
|
+
* Reports unused includes
|
|
22
|
+
* Errors if the includes are not found
|
|
23
23
|
* Error if including a main program`,
|
|
24
24
|
tags: [_irule_1.RuleTag.Syntax],
|
|
25
25
|
};
|
|
@@ -21,15 +21,15 @@ class CheckNoHandlerPragma extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
title: "Check if NO_HANDLER can be removed",
|
|
22
22
|
shortDescription: `Checks NO_HANDLER pragmas that can be removed`,
|
|
23
23
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
|
-
badExample: `TRY.
|
|
25
|
-
...
|
|
26
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
27
|
-
RETURN. " it has a handler
|
|
24
|
+
badExample: `TRY.
|
|
25
|
+
...
|
|
26
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
27
|
+
RETURN. " it has a handler
|
|
28
28
|
ENDTRY.`,
|
|
29
|
-
goodExample: `TRY.
|
|
30
|
-
...
|
|
31
|
-
CATCH zcx_abapgit_exception.
|
|
32
|
-
RETURN.
|
|
29
|
+
goodExample: `TRY.
|
|
30
|
+
...
|
|
31
|
+
CATCH zcx_abapgit_exception.
|
|
32
|
+
RETURN.
|
|
33
33
|
ENDTRY.`,
|
|
34
34
|
};
|
|
35
35
|
}
|