@abaplint/core 2.120.0 → 2.120.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/README.md +6 -6
- package/build/src/cds/expressions/cds_define_abstract.js +1 -1
- package/build/src/cds/expressions/cds_define_custom.js +1 -1
- package/build/src/cds/expressions/cds_define_external_entity.js +1 -1
- package/build/src/cds/expressions/cds_define_hierarchy.js +1 -1
- package/build/src/cds/expressions/cds_define_projection.js +1 -1
- package/build/src/cds/expressions/cds_define_table_entity.js +1 -1
- package/build/src/lsp/help.js +10 -10
- package/build/src/registry.js +1 -1
- package/build/src/rules/7bit_ascii.js +4 -4
- package/build/src/rules/abapdoc.js +4 -4
- package/build/src/rules/add_test_attributes.js +20 -20
- package/build/src/rules/align_parameters.js +40 -40
- package/build/src/rules/align_type_expressions.js +28 -28
- package/build/src/rules/ambiguous_statement.js +7 -7
- package/build/src/rules/avoid_use.js +10 -10
- package/build/src/rules/begin_end_names.js +4 -4
- package/build/src/rules/begin_single_include.js +13 -13
- package/build/src/rules/call_transaction_authority_check.js +3 -3
- package/build/src/rules/cds_association_name.js +6 -6
- package/build/src/rules/cds_comment_style.js +4 -4
- package/build/src/rules/cds_field_order.js +12 -12
- package/build/src/rules/cds_legacy_view.js +4 -4
- package/build/src/rules/cds_naming.js +7 -7
- package/build/src/rules/chain_mainly_declarations.js +4 -4
- package/build/src/rules/change_if_to_case.js +8 -8
- 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 +4 -4
- package/build/src/rules/check_subrc.js +8 -8
- package/build/src/rules/class_attribute_names.js +6 -6
- package/build/src/rules/classic_exceptions_overlap.js +10 -10
- package/build/src/rules/clear_exporting_parameters.js +254 -0
- package/build/src/rules/commented_code.js +1 -1
- package/build/src/rules/constructor_visibility_public.js +10 -10
- package/build/src/rules/contains_tab.js +2 -2
- package/build/src/rules/cyclic_oo.js +4 -4
- package/build/src/rules/dangerous_statement.js +1 -1
- package/build/src/rules/db_operation_in_loop.js +9 -9
- package/build/src/rules/definitions_top.js +6 -6
- package/build/src/rules/downport.js +83 -83
- package/build/src/rules/easy_to_find_messages.js +6 -6
- package/build/src/rules/empty_event.js +6 -6
- package/build/src/rules/empty_line_in_statement.js +2 -2
- package/build/src/rules/empty_structure.js +6 -6
- package/build/src/rules/exit_or_check.js +7 -7
- package/build/src/rules/expand_macros.js +5 -5
- 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/form_tables_obsolete.js +2 -2
- package/build/src/rules/fully_type_itabs.js +2 -2
- package/build/src/rules/function_module_recommendations.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 +12 -12
- package/build/src/rules/identical_contents.js +14 -14
- package/build/src/rules/identical_descriptions.js +6 -6
- package/build/src/rules/identical_move.js +2 -2
- package/build/src/rules/if_in_if.js +35 -35
- package/build/src/rules/implement_methods.js +3 -3
- package/build/src/rules/implicit_start_of_selection.js +4 -4
- package/build/src/rules/in_statement_indentation.js +11 -11
- package/build/src/rules/indentation.js +16 -16
- package/build/src/rules/index.js +1 -0
- package/build/src/rules/intf_referencing_clas.js +3 -3
- package/build/src/rules/invalid_table_index.js +2 -2
- package/build/src/rules/line_break_style.js +2 -2
- package/build/src/rules/line_length.js +2 -2
- package/build/src/rules/line_only_punc.js +1 -1
- package/build/src/rules/local_class_naming.js +2 -2
- package/build/src/rules/local_variable_names.js +6 -6
- package/build/src/rules/macro_naming.js +2 -2
- package/build/src/rules/main_file_contents.js +4 -4
- 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 +5 -5
- package/build/src/rules/method_length.js +2 -2
- package/build/src/rules/method_overwrites_builtin.js +12 -12
- package/build/src/rules/method_parameter_names.js +4 -4
- package/build/src/rules/mix_returning.js +8 -8
- package/build/src/rules/nesting.js +1 -1
- package/build/src/rules/no_aliases.js +5 -5
- package/build/src/rules/no_chained_assignment.js +1 -1
- package/build/src/rules/no_comments_between_methods.js +12 -12
- 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_macros.js +4 -4
- package/build/src/rules/no_prefixes.js +6 -6
- package/build/src/rules/no_public_attributes.js +7 -7
- 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 +51 -51
- 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 +9 -9
- package/build/src/rules/prefer_raise_exception_new.js +5 -5
- package/build/src/rules/prefer_returning_to_exporting.js +4 -4
- package/build/src/rules/prefer_xsdbool.js +2 -2
- package/build/src/rules/preferred_compare_operator.js +2 -2
- package/build/src/rules/prefix_is_current_class.js +6 -6
- package/build/src/rules/reduce_procedural_code.js +17 -17
- package/build/src/rules/redundant_conversion.js +2 -2
- package/build/src/rules/remove_descriptions.js +4 -4
- package/build/src/rules/rfc_error_handling.js +7 -7
- package/build/src/rules/select_add_order_by.js +5 -5
- package/build/src/rules/select_performance.js +5 -5
- package/build/src/rules/select_single_full_key.js +2 -2
- package/build/src/rules/selection_screen_texts_missing.js +2 -2
- package/build/src/rules/sicf_consistency.js +2 -2
- package/build/src/rules/slow_parameter_passing.js +16 -16
- package/build/src/rules/space_before_dot.js +2 -2
- package/build/src/rules/sql_value_conversion.js +6 -6
- package/build/src/rules/start_at_tab.js +1 -1
- package/build/src/rules/static_call_via_instance.js +4 -4
- package/build/src/rules/strict_sql.js +6 -6
- package/build/src/rules/sy_modification.js +6 -6
- package/build/src/rules/tabl_enhancement_category.js +2 -2
- package/build/src/rules/tables_declared_locally.js +2 -2
- package/build/src/rules/type_form_parameters.js +2 -2
- package/build/src/rules/unnecessary_pragma.js +29 -29
- package/build/src/rules/unnecessary_return.js +11 -11
- package/build/src/rules/unused_macros.js +6 -6
- package/build/src/rules/unused_methods.js +12 -12
- package/build/src/rules/unused_variables.js +12 -12
- package/build/src/rules/use_bool_expression.js +8 -8
- package/build/src/rules/use_class_based_exceptions.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/rules/xml_consistency.js +3 -3
- package/package.json +72 -72
|
@@ -54,9 +54,9 @@ class IdenticalMove extends _abap_rule_1.ABAPRule {
|
|
|
54
54
|
title: "Identical move",
|
|
55
55
|
shortDescription: `Moving the same value from left to right or right to left is redundant.`,
|
|
56
56
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
57
|
-
badExample: `DATA lv_value TYPE i.
|
|
57
|
+
badExample: `DATA lv_value TYPE i.
|
|
58
58
|
lv_value = lv_value.`,
|
|
59
|
-
goodExample: `DATA lv_value TYPE i.
|
|
59
|
+
goodExample: `DATA lv_value TYPE i.
|
|
60
60
|
lv_value = 5.`,
|
|
61
61
|
};
|
|
62
62
|
}
|
|
@@ -54,43 +54,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
54
54
|
key: "if_in_if",
|
|
55
55
|
title: "IF in IF",
|
|
56
56
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
57
|
-
extendedInformation: `
|
|
58
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
59
|
-
|
|
60
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61
|
-
|
|
62
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
57
|
+
extendedInformation: `
|
|
58
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
59
|
+
|
|
60
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61
|
+
|
|
62
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63
63
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
64
|
-
badExample: `IF condition1.
|
|
65
|
-
IF condition2.
|
|
66
|
-
...
|
|
67
|
-
ENDIF.
|
|
68
|
-
ENDIF.
|
|
69
|
-
|
|
70
|
-
IF condition1.
|
|
71
|
-
...
|
|
72
|
-
ELSE.
|
|
73
|
-
IF condition2.
|
|
74
|
-
...
|
|
75
|
-
ENDIF.
|
|
64
|
+
badExample: `IF condition1.
|
|
65
|
+
IF condition2.
|
|
66
|
+
...
|
|
67
|
+
ENDIF.
|
|
68
|
+
ENDIF.
|
|
69
|
+
|
|
70
|
+
IF condition1.
|
|
71
|
+
...
|
|
72
|
+
ELSE.
|
|
73
|
+
IF condition2.
|
|
74
|
+
...
|
|
75
|
+
ENDIF.
|
|
76
76
|
ENDIF.`,
|
|
77
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
78
|
-
...
|
|
79
|
-
ENDIF.
|
|
80
|
-
|
|
81
|
-
IF condition1.
|
|
82
|
-
...
|
|
83
|
-
ELSEIF condition2.
|
|
84
|
-
...
|
|
85
|
-
ENDIF.
|
|
86
|
-
|
|
87
|
-
CASE variable.
|
|
88
|
-
WHEN value1.
|
|
89
|
-
...
|
|
90
|
-
WHEN value2.
|
|
91
|
-
IF condition2.
|
|
92
|
-
...
|
|
93
|
-
ENDIF.
|
|
77
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
78
|
+
...
|
|
79
|
+
ENDIF.
|
|
80
|
+
|
|
81
|
+
IF condition1.
|
|
82
|
+
...
|
|
83
|
+
ELSEIF condition2.
|
|
84
|
+
...
|
|
85
|
+
ENDIF.
|
|
86
|
+
|
|
87
|
+
CASE variable.
|
|
88
|
+
WHEN value1.
|
|
89
|
+
...
|
|
90
|
+
WHEN value2.
|
|
91
|
+
IF condition2.
|
|
92
|
+
...
|
|
93
|
+
ENDIF.
|
|
94
94
|
ENDCASE.`,
|
|
95
95
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
96
96
|
};
|
|
@@ -143,9 +143,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
143
143
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
144
144
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
145
145
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
146
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
147
|
-
METHOD ${methodName.toLowerCase()}.
|
|
148
|
-
RETURN. " todo, implement method
|
|
146
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
147
|
+
METHOD ${methodName.toLowerCase()}.
|
|
148
|
+
RETURN. " todo, implement method
|
|
149
149
|
ENDMETHOD.`);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -55,13 +55,13 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
55
55
|
key: "implicit_start_of_selection",
|
|
56
56
|
title: "Implicit START-OF-SELECTION",
|
|
57
57
|
shortDescription: `Add explicit selection screen event handling`,
|
|
58
|
-
extendedInformation: `Only runs for executable programs
|
|
59
|
-
|
|
58
|
+
extendedInformation: `Only runs for executable programs
|
|
59
|
+
|
|
60
60
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
61
61
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62
|
-
badExample: `REPORT zfoo.
|
|
62
|
+
badExample: `REPORT zfoo.
|
|
63
63
|
WRITE 'hello'.`,
|
|
64
|
-
goodExample: `START-OF-SELECTION.
|
|
64
|
+
goodExample: `START-OF-SELECTION.
|
|
65
65
|
WRITE 'hello'.`,
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -64,19 +64,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
64
64
|
key: "in_statement_indentation",
|
|
65
65
|
title: "In-statement indentation",
|
|
66
66
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
67
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
68
|
-
|
|
69
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
67
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
68
|
+
|
|
69
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
70
70
|
to distinguish them better from code within the block.`,
|
|
71
|
-
badExample: `IF 1 = 1
|
|
72
|
-
AND 2 = 2.
|
|
73
|
-
WRITE 'hello' &&
|
|
74
|
-
'world'.
|
|
71
|
+
badExample: `IF 1 = 1
|
|
72
|
+
AND 2 = 2.
|
|
73
|
+
WRITE 'hello' &&
|
|
74
|
+
'world'.
|
|
75
75
|
ENDIF.`,
|
|
76
|
-
goodExample: `IF 1 = 1
|
|
77
|
-
AND 2 = 2.
|
|
78
|
-
WRITE 'hello' &&
|
|
79
|
-
'world'.
|
|
76
|
+
goodExample: `IF 1 = 1
|
|
77
|
+
AND 2 = 2.
|
|
78
|
+
WRITE 'hello' &&
|
|
79
|
+
'world'.
|
|
80
80
|
ENDIF.`,
|
|
81
81
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
82
82
|
};
|
|
@@ -74,23 +74,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
74
74
|
title: "Indentation",
|
|
75
75
|
shortDescription: `Checks indentation`,
|
|
76
76
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
77
|
-
badExample: `CLASS lcl DEFINITION.
|
|
78
|
-
PRIVATE SECTION.
|
|
79
|
-
METHODS constructor.
|
|
80
|
-
ENDCLASS.
|
|
81
|
-
|
|
82
|
-
CLASS lcl IMPLEMENTATION.
|
|
83
|
-
METHOD constructor.
|
|
84
|
-
ENDMETHOD.
|
|
77
|
+
badExample: `CLASS lcl DEFINITION.
|
|
78
|
+
PRIVATE SECTION.
|
|
79
|
+
METHODS constructor.
|
|
80
|
+
ENDCLASS.
|
|
81
|
+
|
|
82
|
+
CLASS lcl IMPLEMENTATION.
|
|
83
|
+
METHOD constructor.
|
|
84
|
+
ENDMETHOD.
|
|
85
85
|
ENDCLASS.`,
|
|
86
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
87
|
-
PRIVATE SECTION.
|
|
88
|
-
METHODS constructor.
|
|
89
|
-
ENDCLASS.
|
|
90
|
-
|
|
91
|
-
CLASS lcl IMPLEMENTATION.
|
|
92
|
-
METHOD constructor.
|
|
93
|
-
ENDMETHOD.
|
|
86
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
87
|
+
PRIVATE SECTION.
|
|
88
|
+
METHODS constructor.
|
|
89
|
+
ENDCLASS.
|
|
90
|
+
|
|
91
|
+
CLASS lcl IMPLEMENTATION.
|
|
92
|
+
METHOD constructor.
|
|
93
|
+
ENDMETHOD.
|
|
94
94
|
ENDCLASS.`,
|
|
95
95
|
};
|
|
96
96
|
}
|
package/build/src/rules/index.js
CHANGED
|
@@ -45,6 +45,7 @@ __exportStar(require("./check_subrc"), exports);
|
|
|
45
45
|
__exportStar(require("./check_syntax"), exports);
|
|
46
46
|
__exportStar(require("./check_text_elements"), exports);
|
|
47
47
|
__exportStar(require("./check_transformation_exists"), exports);
|
|
48
|
+
__exportStar(require("./clear_exporting_parameters"), exports);
|
|
48
49
|
__exportStar(require("./class_attribute_names"), exports);
|
|
49
50
|
__exportStar(require("./classic_exceptions_overlap"), exports);
|
|
50
51
|
__exportStar(require("./cloud_types"), exports);
|
|
@@ -26,9 +26,9 @@ class IntfReferencingClas {
|
|
|
26
26
|
key: "intf_referencing_clas",
|
|
27
27
|
title: "INTF referencing CLAS",
|
|
28
28
|
shortDescription: `Interface contains references to class`,
|
|
29
|
-
extendedInformation: `Only global interfaces are checked.
|
|
30
|
-
Only first level references are checked.
|
|
31
|
-
Exception class references are ignored.
|
|
29
|
+
extendedInformation: `Only global interfaces are checked.
|
|
30
|
+
Only first level references are checked.
|
|
31
|
+
Exception class references are ignored.
|
|
32
32
|
Void references are ignored.`,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
@@ -55,9 +55,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
55
55
|
title: "Invalid Table Index",
|
|
56
56
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
57
57
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
58
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
58
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
59
59
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
60
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
60
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
61
61
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
@@ -15,8 +15,8 @@ class LineBreakStyle {
|
|
|
15
15
|
return {
|
|
16
16
|
key: "line_break_style",
|
|
17
17
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
18
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
19
|
-
|
|
18
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
19
|
+
|
|
20
20
|
abapGit does not work with CRLF`,
|
|
21
21
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
22
22
|
};
|
|
@@ -24,11 +24,11 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
24
24
|
key: "line_length",
|
|
25
25
|
title: "Line length",
|
|
26
26
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
27
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
27
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
28
28
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
29
29
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
30
30
|
badExample: "DATA long_text TYPE string VALUE 'this line keeps going until it is longer than the configured maximum'.",
|
|
31
|
-
goodExample: `DATA long_text TYPE string.
|
|
31
|
+
goodExample: `DATA long_text TYPE string.
|
|
32
32
|
long_text = 'split long expressions across multiple lines'.`,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
@@ -27,7 +27,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
27
27
|
key: "line_only_punc",
|
|
28
28
|
title: "Line containing only punctuation",
|
|
29
29
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
30
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
30
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
31
31
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
32
32
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
33
33
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -30,9 +30,9 @@ class LocalClassNaming extends _abap_rule_1.ABAPRule {
|
|
|
30
30
|
title: "Local class naming conventions",
|
|
31
31
|
shortDescription: `Allows you to enforce a pattern, such as a prefix, for local class names.`,
|
|
32
32
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
33
|
-
badExample: `CLASS helper DEFINITION.
|
|
33
|
+
badExample: `CLASS helper DEFINITION.
|
|
34
34
|
ENDCLASS.`,
|
|
35
|
-
goodExample: `CLASS lcl_helper DEFINITION.
|
|
35
|
+
goodExample: `CLASS lcl_helper DEFINITION.
|
|
36
36
|
ENDCLASS.`,
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -63,15 +63,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63
63
|
return {
|
|
64
64
|
key: "local_variable_names",
|
|
65
65
|
title: "Local variable naming conventions",
|
|
66
|
-
shortDescription: `
|
|
67
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66
|
+
shortDescription: `
|
|
67
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
68
68
|
Regexes are case-insensitive.`,
|
|
69
69
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
70
|
-
badExample: `FORM bar.
|
|
71
|
-
DATA foo.
|
|
70
|
+
badExample: `FORM bar.
|
|
71
|
+
DATA foo.
|
|
72
72
|
ENDFORM.`,
|
|
73
|
-
goodExample: `FORM bar.
|
|
74
|
-
DATA lv_foo.
|
|
73
|
+
goodExample: `FORM bar.
|
|
74
|
+
DATA lv_foo.
|
|
75
75
|
ENDFORM.`,
|
|
76
76
|
};
|
|
77
77
|
}
|
|
@@ -61,9 +61,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
61
61
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
62
62
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
63
63
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64
|
-
badExample: `DEFINE something.
|
|
64
|
+
badExample: `DEFINE something.
|
|
65
65
|
END-OF-DEFINITION.`,
|
|
66
|
-
goodExample: `DEFINE _something.
|
|
66
|
+
goodExample: `DEFINE _something.
|
|
67
67
|
END-OF-DEFINITION.`,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -57,10 +57,10 @@ class MainFileContents {
|
|
|
57
57
|
title: "Main file contents",
|
|
58
58
|
shortDescription: `Checks related to report declarations.`,
|
|
59
59
|
tags: [_irule_1.RuleTag.Syntax],
|
|
60
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
61
|
-
|
|
62
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
60
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
61
|
+
|
|
62
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64
64
|
`,
|
|
65
65
|
};
|
|
66
66
|
}
|
|
@@ -56,17 +56,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
56
56
|
title: "Too many parentheses",
|
|
57
57
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
58
58
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59
|
-
badExample: `
|
|
60
|
-
IF ( destination IS INITIAL ).
|
|
61
|
-
ENDIF.
|
|
62
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63
|
-
ENDIF.
|
|
59
|
+
badExample: `
|
|
60
|
+
IF ( destination IS INITIAL ).
|
|
61
|
+
ENDIF.
|
|
62
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63
|
+
ENDIF.
|
|
64
64
|
`,
|
|
65
|
-
goodExample: `
|
|
66
|
-
IF destination IS INITIAL.
|
|
67
|
-
ENDIF.
|
|
68
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
69
|
-
ENDIF.
|
|
65
|
+
goodExample: `
|
|
66
|
+
IF destination IS INITIAL.
|
|
67
|
+
ENDIF.
|
|
68
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
69
|
+
ENDIF.
|
|
70
70
|
`,
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -54,14 +54,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
54
54
|
title: "Max one method parameter definition per line",
|
|
55
55
|
shortDescription: `Keep max one method parameter description per line`,
|
|
56
56
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
57
|
-
badExample: `
|
|
58
|
-
METHODS apps_scope_token
|
|
59
|
-
IMPORTING
|
|
57
|
+
badExample: `
|
|
58
|
+
METHODS apps_scope_token
|
|
59
|
+
IMPORTING
|
|
60
60
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
61
|
-
goodExample: `
|
|
62
|
-
METHODS apps_scope_token
|
|
63
|
-
IMPORTING
|
|
64
|
-
body TYPE bodyapps_scope_token
|
|
61
|
+
goodExample: `
|
|
62
|
+
METHODS apps_scope_token
|
|
63
|
+
IMPORTING
|
|
64
|
+
body TYPE bodyapps_scope_token
|
|
65
65
|
client_id TYPE str.`,
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -21,11 +21,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
key: "max_one_statement",
|
|
22
22
|
title: "Max one statement per line",
|
|
23
23
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
24
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
25
|
-
|
|
26
|
-
Does not report anything for chained statements.
|
|
27
|
-
|
|
28
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
24
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
25
|
+
|
|
26
|
+
Does not report anything for chained statements.
|
|
27
|
+
|
|
28
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
29
29
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
30
30
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
31
31
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -71,8 +71,8 @@ class MethodLength {
|
|
|
71
71
|
key: "method_length",
|
|
72
72
|
title: "Method/Form/Function Module Length",
|
|
73
73
|
shortDescription: `Checks relating to method/form/function module length.`,
|
|
74
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
75
|
-
|
|
74
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
75
|
+
|
|
76
76
|
Abstract methods without statements are considered okay.`,
|
|
77
77
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
78
78
|
};
|
|
@@ -19,20 +19,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
19
19
|
key: "method_overwrites_builtin",
|
|
20
20
|
title: "Method name overwrites builtin function",
|
|
21
21
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
22
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
23
|
-
|
|
24
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
25
|
-
|
|
22
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
23
|
+
|
|
24
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
25
|
+
|
|
26
26
|
Interface method names are ignored`,
|
|
27
27
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
28
|
-
badExample: `CLASS lcl DEFINITION.
|
|
29
|
-
PUBLIC SECTION.
|
|
30
|
-
METHODS matches.
|
|
31
|
-
ENDCLASS.
|
|
32
|
-
|
|
33
|
-
CLASS lcl IMPLEMENTATION.
|
|
34
|
-
METHOD matches.
|
|
35
|
-
ENDMETHOD.
|
|
28
|
+
badExample: `CLASS lcl DEFINITION.
|
|
29
|
+
PUBLIC SECTION.
|
|
30
|
+
METHODS matches.
|
|
31
|
+
ENDCLASS.
|
|
32
|
+
|
|
33
|
+
CLASS lcl IMPLEMENTATION.
|
|
34
|
+
METHOD matches.
|
|
35
|
+
ENDMETHOD.
|
|
36
36
|
ENDCLASS.`,
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -34,11 +34,11 @@ class MethodParameterNames {
|
|
|
34
34
|
title: "Method parameter naming conventions",
|
|
35
35
|
shortDescription: `Allows you to enforce a pattern, such as a prefix, for method parameter names`,
|
|
36
36
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
37
|
-
badExample: `METHODS get_name
|
|
38
|
-
IMPORTING customer TYPE string
|
|
37
|
+
badExample: `METHODS get_name
|
|
38
|
+
IMPORTING customer TYPE string
|
|
39
39
|
RETURNING VALUE(name) TYPE string.`,
|
|
40
|
-
goodExample: `METHODS get_name
|
|
41
|
-
IMPORTING iv_customer TYPE string
|
|
40
|
+
goodExample: `METHODS get_name
|
|
41
|
+
IMPORTING iv_customer TYPE string
|
|
42
42
|
RETURNING VALUE(rv_name) TYPE string.`,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -54,16 +54,16 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
54
54
|
key: "mix_returning",
|
|
55
55
|
title: "Mix of returning and exporting",
|
|
56
56
|
shortDescription: `Checks that methods don't have a mixture of returning and exporting/changing parameters`,
|
|
57
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination
|
|
58
|
-
|
|
57
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination
|
|
58
|
+
|
|
59
59
|
This syntax is not allowed on versions earlier than 740sp02, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abennews-740-abap_objects.htm#!ABAP_MODIFICATION_1@1@`,
|
|
60
60
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Syntax],
|
|
61
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62
|
-
PUBLIC SECTION.
|
|
63
|
-
METHODS
|
|
64
|
-
foobar
|
|
65
|
-
EXPORTING foo TYPE i
|
|
66
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
61
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62
|
+
PUBLIC SECTION.
|
|
63
|
+
METHODS
|
|
64
|
+
foobar
|
|
65
|
+
EXPORTING foo TYPE i
|
|
66
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
67
67
|
ENDCLASS.`,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -57,7 +57,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
57
57
|
key: "nesting",
|
|
58
58
|
title: "Check nesting depth",
|
|
59
59
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
60
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
60
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
61
61
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
62
62
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63
63
|
};
|
|
@@ -25,12 +25,12 @@ class NoAliases extends _abap_rule_1.ABAPRule {
|
|
|
25
25
|
title: "No ALIASES",
|
|
26
26
|
shortDescription: `Detects use of the ALIAS statement`,
|
|
27
27
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
28
|
-
badExample: `INTERFACE lif_foo.
|
|
29
|
-
METHODS long_method_name.
|
|
30
|
-
ALIASES short FOR long_method_name.
|
|
28
|
+
badExample: `INTERFACE lif_foo.
|
|
29
|
+
METHODS long_method_name.
|
|
30
|
+
ALIASES short FOR long_method_name.
|
|
31
31
|
ENDINTERFACE.`,
|
|
32
|
-
goodExample: `INTERFACE lif_foo.
|
|
33
|
-
METHODS long_method_name.
|
|
32
|
+
goodExample: `INTERFACE lif_foo.
|
|
33
|
+
METHODS long_method_name.
|
|
34
34
|
ENDINTERFACE.`,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -57,7 +57,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
57
57
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
58
58
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
59
59
|
badExample: `var1 = var2 = var3.`,
|
|
60
|
-
goodExample: `var2 = var3.
|
|
60
|
+
goodExample: `var2 = var3.
|
|
61
61
|
var1 = var2.`,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
@@ -55,19 +55,19 @@ class NoCommentsBetweenMethods extends _abap_rule_1.ABAPRule {
|
|
|
55
55
|
title: "No comments between methods in global classes",
|
|
56
56
|
shortDescription: `It's not possible to have comments between methods in global classes.`,
|
|
57
57
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Syntax],
|
|
58
|
-
badExample: `CLASS zcl_foo IMPLEMENTATION.
|
|
59
|
-
METHOD first.
|
|
60
|
-
ENDMETHOD.
|
|
61
|
-
" comment
|
|
62
|
-
METHOD second.
|
|
63
|
-
ENDMETHOD.
|
|
58
|
+
badExample: `CLASS zcl_foo IMPLEMENTATION.
|
|
59
|
+
METHOD first.
|
|
60
|
+
ENDMETHOD.
|
|
61
|
+
" comment
|
|
62
|
+
METHOD second.
|
|
63
|
+
ENDMETHOD.
|
|
64
64
|
ENDCLASS.`,
|
|
65
|
-
goodExample: `CLASS zcl_foo IMPLEMENTATION.
|
|
66
|
-
METHOD first.
|
|
67
|
-
ENDMETHOD.
|
|
68
|
-
|
|
69
|
-
METHOD second.
|
|
70
|
-
ENDMETHOD.
|
|
65
|
+
goodExample: `CLASS zcl_foo IMPLEMENTATION.
|
|
66
|
+
METHOD first.
|
|
67
|
+
ENDMETHOD.
|
|
68
|
+
|
|
69
|
+
METHOD second.
|
|
70
|
+
ENDMETHOD.
|
|
71
71
|
ENDCLASS.`,
|
|
72
72
|
};
|
|
73
73
|
}
|
|
@@ -53,8 +53,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
53
53
|
key: "no_external_form_calls",
|
|
54
54
|
title: "No external FORM calls",
|
|
55
55
|
shortDescription: `Detect external form calls`,
|
|
56
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
57
|
-
|
|
56
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
57
|
+
|
|
58
58
|
PERFORM foo(bar).`,
|
|
59
59
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60
60
|
};
|
|
@@ -54,17 +54,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
54
54
|
key: "no_inline_in_optional_branches",
|
|
55
55
|
title: "Don't declare inline in optional branches",
|
|
56
56
|
shortDescription: `Don't declare inline in optional branches`,
|
|
57
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
58
|
-
|
|
59
|
-
Considered optional branches:
|
|
60
|
-
* inside IF/ELSEIF/ELSE
|
|
61
|
-
* inside LOOP
|
|
62
|
-
* inside WHILE
|
|
63
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
64
|
-
* inside DO
|
|
65
|
-
* inside SELECT loops
|
|
66
|
-
|
|
67
|
-
Not considered optional branches:
|
|
57
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
58
|
+
|
|
59
|
+
Considered optional branches:
|
|
60
|
+
* inside IF/ELSEIF/ELSE
|
|
61
|
+
* inside LOOP
|
|
62
|
+
* inside WHILE
|
|
63
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
64
|
+
* inside DO
|
|
65
|
+
* inside SELECT loops
|
|
66
|
+
|
|
67
|
+
Not considered optional branches:
|
|
68
68
|
* TRY/CATCH/CLEANUP`,
|
|
69
69
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70
70
|
};
|
|
@@ -52,12 +52,12 @@ class NoMacros extends _abap_rule_1.ABAPRule {
|
|
|
52
52
|
key: "no_macros",
|
|
53
53
|
title: "No macros",
|
|
54
54
|
shortDescription: `Checks that macros are not used`,
|
|
55
|
-
extendedInformation: `Macros reduce readability and are difficult to debug, use methods or form routines instead.
|
|
56
|
-
|
|
55
|
+
extendedInformation: `Macros reduce readability and are difficult to debug, use methods or form routines instead.
|
|
56
|
+
|
|
57
57
|
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenmacros_guidl.htm`,
|
|
58
58
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
59
|
-
badExample: `DEFINE _macro.
|
|
60
|
-
WRITE 'hello'.
|
|
59
|
+
badExample: `DEFINE _macro.
|
|
60
|
+
WRITE 'hello'.
|
|
61
61
|
END-OF-DEFINITION.`,
|
|
62
62
|
goodExample: `WRITE 'hello'.`,
|
|
63
63
|
};
|