@abaplint/core 2.90.9 → 2.90.10
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 +15 -0
- package/build/src/abap/2_statements/expressions/association_name.js +11 -0
- package/build/src/abap/2_statements/expressions/index.js +1 -0
- package/build/src/abap/2_statements/statements/commit_entities.js +1 -1
- package/build/src/abap/2_statements/statements/delete_internal.js +3 -2
- package/build/src/abap/2_statements/statements/get_permissions.js +14 -0
- package/build/src/abap/2_statements/statements/index.js +2 -0
- package/build/src/abap/2_statements/statements/modify_entities.js +3 -1
- package/build/src/abap/2_statements/statements/read_entities.js +1 -1
- package/build/src/abap/2_statements/statements/set_locks.js +14 -0
- package/build/src/abap/3_structures/structures/normal.js +1 -1
- package/build/src/abap/5_syntax/_builtin.js +5 -5
- package/build/src/abap/5_syntax/expressions/form_param.js +4 -4
- package/build/src/abap/5_syntax/expressions/inline_data.js +2 -2
- package/build/src/abap/5_syntax/expressions/inline_field_definition.js +1 -1
- package/build/src/abap/5_syntax/expressions/inline_fs.js +2 -2
- package/build/src/abap/5_syntax/expressions/inline_loop_definition.js +2 -2
- package/build/src/abap/5_syntax/statements/catch.js +3 -3
- package/build/src/abap/5_syntax/statements/class_data.js +1 -1
- package/build/src/abap/5_syntax/statements/constant.js +1 -1
- package/build/src/abap/5_syntax/statements/selection_screen.js +2 -2
- package/build/src/abap/5_syntax/structures/class_data.js +1 -1
- package/build/src/abap/5_syntax/structures/constants.js +1 -1
- package/build/src/abap/5_syntax/structures/type_enum.js +2 -2
- package/build/src/abap/flow/flow_graph.js +7 -7
- package/build/src/abap/types/class_constant.js +1 -1
- package/build/src/abap/types/form_definition.js +2 -2
- package/build/src/abap/types/method_parameters.js +11 -11
- package/build/src/lsp/_lookup.js +1 -1
- package/build/src/lsp/help.js +7 -7
- 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 +8 -8
- 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_subrc.js +8 -8
- package/build/src/rules/classic_exceptions_overlap.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 +65 -65
- package/build/src/rules/exit_or_check.js +4 -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 +8 -8
- 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/method_overwrites_builtin.js +2 -2
- package/build/src/rules/nesting.js +1 -1
- package/build/src/rules/no_chained_assignment.js +1 -1
- package/build/src/rules/no_external_form_calls.js +2 -2
- package/build/src/rules/no_inline_in_optional_branches.js +11 -11
- package/build/src/rules/no_public_attributes.js +1 -1
- package/build/src/rules/no_yoda_conditions.js +4 -4
- package/build/src/rules/nrob_consistency.js +2 -2
- package/build/src/rules/obsolete_statement.js +40 -40
- package/build/src/rules/omit_parameter_name.js +8 -6
- 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 +18 -18
- 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 +5 -5
- package/build/src/rules/select_performance.js +2 -2
- package/build/src/rules/sicf_consistency.js +2 -2
- package/build/src/rules/slow_parameter_passing.js +1 -1
- 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/unnecessary_pragma.js +14 -14
- package/build/src/rules/unused_methods.js +9 -9
- package/build/src/rules/unused_variables.js +9 -9
- 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/package.json +65 -65
|
@@ -21,7 +21,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
return {
|
|
22
22
|
key: "parser_missing_space",
|
|
23
23
|
title: "Parser Error, missing space",
|
|
24
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
24
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
25
25
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
26
26
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
27
27
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -23,25 +23,25 @@ class PreferInline {
|
|
|
23
23
|
key: "prefer_inline",
|
|
24
24
|
title: "Prefer Inline Declarations",
|
|
25
25
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
26
|
-
extendedInformation: `EXPERIMENTAL
|
|
27
|
-
|
|
28
|
-
Activates if language version is v740sp02 or above.
|
|
29
|
-
|
|
30
|
-
Variables must be local(METHOD or FORM).
|
|
31
|
-
|
|
32
|
-
No generic or void typed variables.
|
|
33
|
-
|
|
34
|
-
First position used must be a full/pure write.
|
|
35
|
-
|
|
36
|
-
Move statment is not a cast(?=)
|
|
37
|
-
|
|
26
|
+
extendedInformation: `EXPERIMENTAL
|
|
27
|
+
|
|
28
|
+
Activates if language version is v740sp02 or above.
|
|
29
|
+
|
|
30
|
+
Variables must be local(METHOD or FORM).
|
|
31
|
+
|
|
32
|
+
No generic or void typed variables.
|
|
33
|
+
|
|
34
|
+
First position used must be a full/pure write.
|
|
35
|
+
|
|
36
|
+
Move statment is not a cast(?=)
|
|
37
|
+
|
|
38
38
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
39
39
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
40
|
-
badExample: `DATA foo TYPE i.
|
|
41
|
-
foo = 2.
|
|
42
|
-
DATA percentage TYPE decfloat34.
|
|
40
|
+
badExample: `DATA foo TYPE i.
|
|
41
|
+
foo = 2.
|
|
42
|
+
DATA percentage TYPE decfloat34.
|
|
43
43
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
44
|
-
goodExample: `DATA(foo) = 2.
|
|
44
|
+
goodExample: `DATA(foo) = 2.
|
|
45
45
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -80,8 +80,8 @@ DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 10
|
|
|
80
80
|
for (const name in vars) {
|
|
81
81
|
const identifier = vars[name];
|
|
82
82
|
if (this.isLocalDefinition(node, identifier) === false
|
|
83
|
-
|| identifier.getMeta().includes("inline" /* InlineDefinition */)
|
|
84
|
-
|| identifier.getMeta().includes("form_parameter" /* FormParameter */)) {
|
|
83
|
+
|| identifier.getMeta().includes("inline" /* IdentifierMeta.InlineDefinition */)
|
|
84
|
+
|| identifier.getMeta().includes("form_parameter" /* IdentifierMeta.FormParameter */)) {
|
|
85
85
|
continue;
|
|
86
86
|
}
|
|
87
87
|
else if (identifier.getType().isGeneric() === true) {
|
|
@@ -21,16 +21,16 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
key: "prefer_is_not",
|
|
22
22
|
title: "Prefer IS NOT to NOT IS",
|
|
23
23
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
24
|
-
extendedInformation: `
|
|
25
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
26
|
-
|
|
24
|
+
extendedInformation: `
|
|
25
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
26
|
+
|
|
27
27
|
"if not is_valid( )." examples are skipped`,
|
|
28
28
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
29
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
30
|
-
IF variable NP 'TODO*'.
|
|
29
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
30
|
+
IF variable NP 'TODO*'.
|
|
31
31
|
IF variable <> 42.`,
|
|
32
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
33
|
-
IF NOT variable CP 'TODO*'.
|
|
32
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
33
|
+
IF NOT variable CP 'TODO*'.
|
|
34
34
|
IF NOT variable = 42.`,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -20,12 +20,12 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
20
20
|
key: "prefer_raise_exception_new",
|
|
21
21
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
22
22
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
23
|
-
extendedInformation: `
|
|
23
|
+
extendedInformation: `
|
|
24
24
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type`,
|
|
25
25
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
26
26
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
27
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
28
|
-
EXPORTING
|
|
27
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
28
|
+
EXPORTING
|
|
29
29
|
previous = exception.`,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -20,7 +20,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
20
20
|
key: "prefer_returning_to_exporting",
|
|
21
21
|
title: "Prefer RETURNING to EXPORTING",
|
|
22
22
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
23
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
23
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
24
24
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
25
25
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
26
26
|
};
|
|
@@ -21,8 +21,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
key: "prefer_xsdbool",
|
|
22
22
|
title: "Prefer xsdbool over boolc",
|
|
23
23
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
24
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
25
|
-
|
|
24
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
25
|
+
|
|
26
26
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
27
27
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
28
28
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -26,10 +26,10 @@ class RemoveDescriptions {
|
|
|
26
26
|
return {
|
|
27
27
|
key: "remove_descriptions",
|
|
28
28
|
title: "Remove descriptions",
|
|
29
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
30
|
-
|
|
31
|
-
Class descriptions are required, see rule description_empty.
|
|
32
|
-
|
|
29
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
30
|
+
|
|
31
|
+
Class descriptions are required, see rule description_empty.
|
|
32
|
+
|
|
33
33
|
Consider using ABAP Doc for documentation.`,
|
|
34
34
|
tags: [],
|
|
35
35
|
};
|
|
@@ -22,16 +22,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
22
22
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
23
23
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
24
24
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
25
|
-
badExample: `
|
|
26
|
-
CALL FUNCTION 'ZRFC'
|
|
25
|
+
badExample: `
|
|
26
|
+
CALL FUNCTION 'ZRFC'
|
|
27
27
|
DESTINATION lv_rfc.`,
|
|
28
|
-
goodExample: `
|
|
29
|
-
CALL FUNCTION 'ZRFC'
|
|
30
|
-
DESTINATION lv_rfc
|
|
31
|
-
EXCEPTIONS
|
|
32
|
-
system_failure = 1 MESSAGE msg
|
|
33
|
-
communication_failure = 2 MESSAGE msg
|
|
34
|
-
resource_failure = 3
|
|
28
|
+
goodExample: `
|
|
29
|
+
CALL FUNCTION 'ZRFC'
|
|
30
|
+
DESTINATION lv_rfc
|
|
31
|
+
EXCEPTIONS
|
|
32
|
+
system_failure = 1 MESSAGE msg
|
|
33
|
+
communication_failure = 2 MESSAGE msg
|
|
34
|
+
resource_failure = 3
|
|
35
35
|
OTHERS = 4.`,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -21,11 +21,11 @@ class SelectAddOrderBy {
|
|
|
21
21
|
key: "select_add_order_by",
|
|
22
22
|
title: "SELECT add ORDER BY",
|
|
23
23
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
24
|
-
extendedInformation: `
|
|
25
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
26
|
-
|
|
27
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
28
|
-
|
|
24
|
+
extendedInformation: `
|
|
25
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
26
|
+
|
|
27
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
28
|
+
|
|
29
29
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
30
30
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
31
31
|
};
|
|
@@ -32,8 +32,8 @@ class SelectPerformance {
|
|
|
32
32
|
key: "select_performance",
|
|
33
33
|
title: "SELECT performance",
|
|
34
34
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
35
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
36
|
-
|
|
35
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
36
|
+
|
|
37
37
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
38
38
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
39
39
|
};
|
|
@@ -17,8 +17,8 @@ class SICFConsistency {
|
|
|
17
17
|
key: "sicf_consistency",
|
|
18
18
|
title: "SICF consistency",
|
|
19
19
|
shortDescription: `Checks the validity of ICF services`,
|
|
20
|
-
extendedInformation: `* Class defined in handler must exist
|
|
21
|
-
* Class must not have any syntax errors
|
|
20
|
+
extendedInformation: `* Class defined in handler must exist
|
|
21
|
+
* Class must not have any syntax errors
|
|
22
22
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -44,7 +44,7 @@ class SlowParameterPassing {
|
|
|
44
44
|
const vars = m.getData().vars;
|
|
45
45
|
for (const v in vars) {
|
|
46
46
|
const id = vars[v];
|
|
47
|
-
if (id.getMeta().includes("pass_by_value" /* PassByValue */) === false) {
|
|
47
|
+
if (id.getMeta().includes("pass_by_value" /* IdentifierMeta.PassByValue */) === false) {
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
50
|
const writes = this.listWritePositions(m, id);
|
|
@@ -29,8 +29,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
29
29
|
key: "space_before_dot",
|
|
30
30
|
title: "Space before dot",
|
|
31
31
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
32
|
-
extendedInformation: `
|
|
33
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
32
|
+
extendedInformation: `
|
|
33
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
34
34
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
35
35
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
36
36
|
badExample: `WRITE bar .`,
|
|
@@ -20,7 +20,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
20
20
|
key: "start_at_tab",
|
|
21
21
|
title: "Start at tab",
|
|
22
22
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
23
|
-
extendedInformation: `Reports max 100 issues per file
|
|
23
|
+
extendedInformation: `Reports max 100 issues per file
|
|
24
24
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
25
25
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
26
26
|
badExample: ` WRITE a.`,
|
|
@@ -21,8 +21,8 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
shortDescription: `Finds modification of sy fields`,
|
|
22
22
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm`,
|
|
23
23
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
|
-
badExample: `
|
|
25
|
-
sy-uname = 2.
|
|
24
|
+
badExample: `
|
|
25
|
+
sy-uname = 2.
|
|
26
26
|
sy = sy.`,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
@@ -17,8 +17,8 @@ class TABLEnhancementCategory {
|
|
|
17
17
|
key: "tabl_enhancement_category",
|
|
18
18
|
title: "TABL enhancement category must be set",
|
|
19
19
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
20
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
21
|
-
|
|
20
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
21
|
+
|
|
22
22
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
23
23
|
tags: [],
|
|
24
24
|
};
|
|
@@ -21,23 +21,23 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
key: "unnecessary_pragma",
|
|
22
22
|
title: "Unnecessary Pragma",
|
|
23
23
|
shortDescription: `Finds pragmas which can be removed`,
|
|
24
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
25
|
-
|
|
26
|
-
* NEEDED without definition
|
|
27
|
-
|
|
24
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
25
|
+
|
|
26
|
+
* NEEDED without definition
|
|
27
|
+
|
|
28
28
|
* NO_TEXT without texts`,
|
|
29
29
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
30
|
-
badExample: `TRY.
|
|
31
|
-
...
|
|
32
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
33
|
-
RETURN. " it has a handler
|
|
34
|
-
ENDTRY.
|
|
30
|
+
badExample: `TRY.
|
|
31
|
+
...
|
|
32
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
33
|
+
RETURN. " it has a handler
|
|
34
|
+
ENDTRY.
|
|
35
35
|
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.`,
|
|
36
|
-
goodExample: `TRY.
|
|
37
|
-
...
|
|
38
|
-
CATCH zcx_abapgit_exception.
|
|
39
|
-
RETURN.
|
|
40
|
-
ENDTRY.
|
|
36
|
+
goodExample: `TRY.
|
|
37
|
+
...
|
|
38
|
+
CATCH zcx_abapgit_exception.
|
|
39
|
+
RETURN.
|
|
40
|
+
ENDTRY.
|
|
41
41
|
MESSAGE w125(zbar) WITH c_foo INTO message.`,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -55,15 +55,15 @@ class UnusedMethods {
|
|
|
55
55
|
key: "unused_methods",
|
|
56
56
|
title: "Unused methods",
|
|
57
57
|
shortDescription: `Checks for unused methods`,
|
|
58
|
-
extendedInformation: `Checks private and protected methods.
|
|
59
|
-
|
|
60
|
-
Skips:
|
|
61
|
-
* methods FOR TESTING
|
|
62
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
63
|
-
* class_constructor + constructor methods
|
|
64
|
-
* event handlers
|
|
65
|
-
* methods that are redefined
|
|
66
|
-
* INCLUDEs
|
|
58
|
+
extendedInformation: `Checks private and protected methods.
|
|
59
|
+
|
|
60
|
+
Skips:
|
|
61
|
+
* methods FOR TESTING
|
|
62
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
63
|
+
* class_constructor + constructor methods
|
|
64
|
+
* event handlers
|
|
65
|
+
* methods that are redefined
|
|
66
|
+
* INCLUDEs
|
|
67
67
|
`,
|
|
68
68
|
tags: [],
|
|
69
69
|
pragma: "##CALLED",
|
|
@@ -64,12 +64,12 @@ class UnusedVariables {
|
|
|
64
64
|
key: "unused_variables",
|
|
65
65
|
title: "Unused variables",
|
|
66
66
|
shortDescription: `Checks for unused variables and constants`,
|
|
67
|
-
extendedInformation: `WARNING: slow
|
|
68
|
-
|
|
69
|
-
Skips event parameters.
|
|
70
|
-
|
|
71
|
-
Note that this currently does not work if the source code uses macros.
|
|
72
|
-
|
|
67
|
+
extendedInformation: `WARNING: slow
|
|
68
|
+
|
|
69
|
+
Skips event parameters.
|
|
70
|
+
|
|
71
|
+
Note that this currently does not work if the source code uses macros.
|
|
72
|
+
|
|
73
73
|
Unused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,
|
|
74
74
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75
75
|
pragma: "##NEEDED",
|
|
@@ -156,12 +156,12 @@ Unused variables are not reported if the object contains syntax errors. Errors f
|
|
|
156
156
|
}
|
|
157
157
|
else if (name === "ME"
|
|
158
158
|
|| name === "SUPER"
|
|
159
|
-
|| meta.includes("selection_screen_tab" /* SelectionScreenTab */)
|
|
160
|
-
|| meta.includes("event_parameter" /* EventParameter */)) {
|
|
159
|
+
|| meta.includes("selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */)
|
|
160
|
+
|| meta.includes("event_parameter" /* IdentifierMeta.EventParameter */)) {
|
|
161
161
|
// todo, workaround for "me" and "super", these should somehow be typed to built-in
|
|
162
162
|
continue;
|
|
163
163
|
}
|
|
164
|
-
const isInline = meta.includes("inline" /* InlineDefinition */);
|
|
164
|
+
const isInline = meta.includes("inline" /* IdentifierMeta.InlineDefinition */);
|
|
165
165
|
this.workarea.push(vars[name], isInline ? 2 : 1);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -27,15 +27,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
27
27
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
28
28
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
29
29
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
30
|
-
badExample: `IF line IS INITIAL.
|
|
31
|
-
has_entries = abap_false.
|
|
32
|
-
ELSE.
|
|
33
|
-
has_entries = abap_true.
|
|
34
|
-
ENDIF.
|
|
35
|
-
|
|
30
|
+
badExample: `IF line IS INITIAL.
|
|
31
|
+
has_entries = abap_false.
|
|
32
|
+
ELSE.
|
|
33
|
+
has_entries = abap_true.
|
|
34
|
+
ENDIF.
|
|
35
|
+
|
|
36
36
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
37
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
38
|
-
|
|
37
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
38
|
+
|
|
39
39
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -22,15 +22,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
22
22
|
key: "use_line_exists",
|
|
23
23
|
title: "Use line_exists",
|
|
24
24
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
25
|
-
extendedInformation: `
|
|
26
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
27
|
-
|
|
25
|
+
extendedInformation: `
|
|
26
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
27
|
+
|
|
28
28
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
29
29
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
30
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
31
|
-
IF sy-subrc = 0.
|
|
30
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
31
|
+
IF sy-subrc = 0.
|
|
32
32
|
ENDIF.`,
|
|
33
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
33
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
34
34
|
ENDIF.`,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -23,10 +23,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
23
23
|
key: "use_new",
|
|
24
24
|
title: "Use NEW",
|
|
25
25
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
26
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
27
|
-
|
|
28
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
29
|
-
|
|
26
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
27
|
+
|
|
28
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
29
|
+
|
|
30
30
|
Applicable from v740sp02 and up`,
|
|
31
31
|
badExample: `CREATE OBJECT ref.`,
|
|
32
32
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -21,13 +21,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
title: "WHEN OTHERS last",
|
|
22
22
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
23
23
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
|
-
badExample: `CASE bar.
|
|
25
|
-
WHEN OTHERS.
|
|
26
|
-
WHEN 2.
|
|
24
|
+
badExample: `CASE bar.
|
|
25
|
+
WHEN OTHERS.
|
|
26
|
+
WHEN 2.
|
|
27
27
|
ENDCASE.`,
|
|
28
|
-
goodExample: `CASE bar.
|
|
29
|
-
WHEN 2.
|
|
30
|
-
WHEN OTHERS.
|
|
28
|
+
goodExample: `CASE bar.
|
|
29
|
+
WHEN 2.
|
|
30
|
+
WHEN OTHERS.
|
|
31
31
|
ENDCASE.`,
|
|
32
32
|
};
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.90.
|
|
4
|
-
"description": "abaplint - Core API",
|
|
5
|
-
"main": "build/src/index.js",
|
|
6
|
-
"typings": "build/abaplint.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"lint": "eslint src/**/*.ts test/**/*.ts --format unix",
|
|
9
|
-
"lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
|
|
10
|
-
"compile": "tsc && sh scripts/version.sh",
|
|
11
|
-
"test": "npm run compile && mocha --timeout 1000 && npm run lint && npm run schema && api-extractor run",
|
|
12
|
-
"test:only": "npm run compile && mocha",
|
|
13
|
-
"test:parallel": "npm run compile && mocha --timeout 1000 --parallel --reporter dot",
|
|
14
|
-
"coverage": "npm run compile && c8 mocha && c8 report --reporter=html",
|
|
15
|
-
"schema": "node scripts/schema.js > scripts/schema.ts && ts-json-schema-generator --tsconfig tsconfig_schema.json --jsDoc extended --path scripts/schema.ts > scripts/schema.json && node scripts/schema_post.js",
|
|
16
|
-
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
17
|
-
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
|
|
18
|
-
},
|
|
19
|
-
"mocha": {
|
|
20
|
-
"recursive": true,
|
|
21
|
-
"reporter": "progress",
|
|
22
|
-
"spec": "build/test/**/*.js",
|
|
23
|
-
"require": "source-map-support/register"
|
|
24
|
-
},
|
|
25
|
-
"c8": {
|
|
26
|
-
"include": [
|
|
27
|
-
"build/src/**/*.js"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/abaplint/abaplint.git"
|
|
33
|
-
},
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=12.0.0"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"ABAP",
|
|
39
|
-
"lint"
|
|
40
|
-
],
|
|
41
|
-
"author": "Lars Hvam Petersen",
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"bugs": {
|
|
44
|
-
"url": "https://github.com/abaplint/abaplint/issues"
|
|
45
|
-
},
|
|
46
|
-
"homepage": "https://abaplint.org",
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@microsoft/api-extractor": "^7.24.
|
|
49
|
-
"@types/chai": "^4.3.1",
|
|
50
|
-
"@types/mocha": "^9.1.1",
|
|
51
|
-
"@types/node": "^17.0.
|
|
52
|
-
"chai": "^4.3.6",
|
|
53
|
-
"eslint": "^8.16.0",
|
|
54
|
-
"mocha": "^10.0.0",
|
|
55
|
-
"c8": "^7.11.3",
|
|
56
|
-
"source-map-support": "^0.5.21",
|
|
57
|
-
"ts-json-schema-generator": "^1.0.0",
|
|
58
|
-
"typescript": "^4.
|
|
59
|
-
},
|
|
60
|
-
"dependencies": {
|
|
61
|
-
"fast-xml-parser": "^4.0.
|
|
62
|
-
"json5": "^2.2.1",
|
|
63
|
-
"vscode-languageserver-types": "^3.17.1"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abaplint/core",
|
|
3
|
+
"version": "2.90.10",
|
|
4
|
+
"description": "abaplint - Core API",
|
|
5
|
+
"main": "build/src/index.js",
|
|
6
|
+
"typings": "build/abaplint.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"lint": "eslint src/**/*.ts test/**/*.ts --format unix",
|
|
9
|
+
"lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
|
|
10
|
+
"compile": "tsc && sh scripts/version.sh",
|
|
11
|
+
"test": "npm run compile && mocha --timeout 1000 && npm run lint && npm run schema && api-extractor run",
|
|
12
|
+
"test:only": "npm run compile && mocha",
|
|
13
|
+
"test:parallel": "npm run compile && mocha --timeout 1000 --parallel --reporter dot",
|
|
14
|
+
"coverage": "npm run compile && c8 mocha && c8 report --reporter=html",
|
|
15
|
+
"schema": "node scripts/schema.js > scripts/schema.ts && ts-json-schema-generator --tsconfig tsconfig_schema.json --jsDoc extended --path scripts/schema.ts > scripts/schema.json && node scripts/schema_post.js",
|
|
16
|
+
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
17
|
+
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
|
|
18
|
+
},
|
|
19
|
+
"mocha": {
|
|
20
|
+
"recursive": true,
|
|
21
|
+
"reporter": "progress",
|
|
22
|
+
"spec": "build/test/**/*.js",
|
|
23
|
+
"require": "source-map-support/register"
|
|
24
|
+
},
|
|
25
|
+
"c8": {
|
|
26
|
+
"include": [
|
|
27
|
+
"build/src/**/*.js"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/abaplint/abaplint.git"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=12.0.0"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"ABAP",
|
|
39
|
+
"lint"
|
|
40
|
+
],
|
|
41
|
+
"author": "Lars Hvam Petersen",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/abaplint/abaplint/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://abaplint.org",
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@microsoft/api-extractor": "^7.24.2",
|
|
49
|
+
"@types/chai": "^4.3.1",
|
|
50
|
+
"@types/mocha": "^9.1.1",
|
|
51
|
+
"@types/node": "^17.0.38",
|
|
52
|
+
"chai": "^4.3.6",
|
|
53
|
+
"eslint": "^8.16.0",
|
|
54
|
+
"mocha": "^10.0.0",
|
|
55
|
+
"c8": "^7.11.3",
|
|
56
|
+
"source-map-support": "^0.5.21",
|
|
57
|
+
"ts-json-schema-generator": "^1.0.0",
|
|
58
|
+
"typescript": "^4.7.2"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"fast-xml-parser": "^4.0.8",
|
|
62
|
+
"json5": "^2.2.1",
|
|
63
|
+
"vscode-languageserver-types": "^3.17.1"
|
|
64
|
+
}
|
|
65
|
+
}
|