Skip to content

Commit 732f8b5

Browse files
lucasborinEugen Güntherabaplint[bot]
authored
New abapLint Rules (#304)
* Update abaplint.json * Update abaplint.json * Update abaplint.json * Update abaplint.json * disabling empty_line_in_statement * Remove double space * disabling exit_or_check * disabling line_only_punc Reporting false-positives: abaplint/abaplint#1888 * Update abaplint.json * Update abaplint.json * Compare operator "EQ" not preferred * Disabling no_yoda_conditions abaplint/abaplint#1891 * Method "get_first_character" not used * Compare operator "EQ" not preferred * Keep single parameter on one line * Statement "ADD" is obsolete * Compare operator "GE" not preferred Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Compare operator "GE" not preferred Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Compare operator "EQ" not preferred * Avoid use of SELECT * * Uncaught exception cx_sy_itab_line_not_found * Compare operator "EQ", "LT, "GT" not preferred * Reorder definitions to top of routine * Too many parenthesis, simple * Prefer Inline Declarations, CHECK_CONFIGURATION * Missing space between string or character literal * wrongly commited object * Some fixes Compare operator "EQ" not preferred Prefer Inline Declarations, FM_NAME Reorder definitions to top of routine * Statement "ADD" is obsolete * Compare operator "EQ" not preferred * Some fixes Compare operator "EQ" not preferred Statement "ADD" is obsolete Statement "SUBTRACT" is obsolete Line break multiple parameters * Some fixes Compare operator "EQ" not preferred Method "check_token_content" not used Statement "ADD" is obsolete * Some fixes Line break multiple parameters Compare operator "GE" not preferred Compare operator "EQ" not preferred * ops, fixing bug * Compare operator "EQ" not preferred * Statement "ADD" is obsolete * Some fixes Statement "ADD" is obsolete Statement "SUBTRACT" is obsolete Too many parenthesis, complex * Some fixes Omit default parameter name "FIRST_TOKEN" Statement "SUBTRACT" is obsolete Statement "ADD" is obsolete * several fixes * Update y_check_unit_test_assert.clas.abap * Update abaplint.json * Update abaplint.json * Update abaplint.json * Several fixes * several fixes * SEVERAL FIXES * Update abaplint.json * Update abaplint.json * several fixes * Update abaplint.json * Update abaplint.json * Update abaplint.json * Update abaplint.json * a few fixes * Update abaplint.json * several fixes * Update abaplint.json * several fixes * Update abaplint.json * a few fixes * Update abaplint.json * Update y_exemption_general.clas.abap * Update y_test_code_detector.clas.abap * Update y_check_empty_catches.clas.abap * Don't mix RETURNING and EXPORTING/CHANGING paramet * Update abaplint.json * Update abaplint.json * Update abaplint.json Co-authored-by: Eugen Günther <[email protected]> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
1 parent 16d6349 commit 732f8b5

File tree

56 files changed

+602
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+602
-711
lines changed

abaplint.json

Lines changed: 65 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -12,230 +12,153 @@
1212
"url": "https://github.com/abaplint/deps",
1313
"folder": "/deps1",
1414
"files": "/src/**/*.*"
15-
},
16-
{
17-
"url": "https://github.com/abapGit/abapGit",
18-
"folder": "/deps2",
19-
"files": "/src/**/*.*"
2015
}
2116
],
2217
"syntax": {
2318
"version": "v740sp08",
24-
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
19+
"errorNamespace": "^(Y)",
2520
"globalConstants": ["cntb_btype_button", "scan_struc_stmnt_type", "scan_stmnt_type", "scan_struc_type", "scan_token_type"],
2621
"globalMacros": []
2722
},
2823
"rules": {
2924
"7bit_ascii": true,
3025
"abapdoc": false,
3126
"allowed_object_naming": true,
32-
"allowed_object_types": {
33-
"exclude": [],
34-
"severity": "Error",
35-
"allowed": []
36-
},
27+
"allowed_object_types": false,
3728
"ambiguous_statement": false,
38-
"avoid_use": {
39-
"exclude": [],
40-
"severity": "Error",
41-
"define": true,
42-
"endselect": true,
43-
"execSQL": true,
44-
"kernelCall": true,
45-
"communication": true,
46-
"statics": true,
47-
"systemCall": true,
48-
"defaultKey": false,
49-
"break": false,
50-
"describeLines": false
51-
},
29+
"avoid_use": false,
5230
"begin_end_names": true,
5331
"begin_single_include": true,
54-
"call_transaction_authority_check": true,
55-
"chain_mainly_declarations": {
56-
"exclude": [],
57-
"severity": "Error",
58-
"definitions": true,
59-
"write": true,
60-
"move": true,
61-
"refresh": true,
62-
"unassign": true,
63-
"clear": true,
64-
"hide": true,
65-
"free": true,
66-
"include": true,
67-
"check": true
68-
},
32+
"call_transaction_authority_check": false,
33+
"chain_mainly_declarations": true,
6934
"check_abstract": true,
7035
"check_comments": false,
71-
"check_ddic": true,
36+
"check_ddic": false,
7237
"check_include": true,
7338
"check_no_handler_pragma": true,
7439
"check_subrc": false,
7540
"check_syntax": true,
7641
"check_text_elements": false,
77-
"check_transformation_exists": true,
42+
"check_transformation_exists": false,
7843
"class_attribute_names": false,
7944
"cloud_types": true,
8045
"colon_missing_space": true,
81-
"commented_code": false,
46+
"commented_code": true,
8247
"constructor_visibility_public": true,
8348
"contains_tab": false,
84-
"cyclomatic_complexity": {
85-
"exclude": [],
86-
"severity": "Error",
87-
"max": 20
88-
},
89-
"definitions_top": false,
49+
"cyclomatic_complexity": true,
50+
"dangerous_statement": true,
51+
"db_operation_in_loop": false,
52+
"definitions_top": true,
9053
"description_empty": true,
91-
"double_space": false,
54+
"double_space": {
55+
"startParen": false
56+
},
9257
"downport": true,
9358
"empty_line_in_statement": false,
9459
"empty_statement": true,
95-
"empty_structure": false,
60+
"empty_structure": true,
9661
"exit_or_check": false,
97-
"exporting": false,
98-
"forbidden_identifier": {
99-
"exclude": [],
100-
"severity": "Error",
101-
"check": []
102-
},
103-
"forbidden_pseudo_and_pragma": {
104-
"exclude": [],
105-
"severity": "Error",
106-
"pseudo": [],
107-
"pragmas": [],
108-
"ignoreGlobalClassDefinition": false,
109-
"ignoreGlobalInterface": false
110-
},
111-
"forbidden_void_type": {
112-
"exclude": [],
113-
"severity": "Error",
114-
"check": []
115-
},
62+
"exporting": true,
63+
"forbidden_identifier": false,
64+
"forbidden_pseudo_and_pragma": false,
65+
"forbidden_void_type": false,
11666
"form_tables_obsolete": true,
117-
"fully_type_constants": {
118-
"exclude": [],
119-
"severity": "Error",
120-
"checkData": true
121-
},
67+
"fully_type_constants": false,
12268
"function_module_recommendations": true,
123-
"functional_writing": {
124-
"exclude": [],
125-
"severity": "Error",
126-
"ignoreExceptions": true
127-
},
69+
"functional_writing": true,
12870
"global_class": true,
12971
"identical_conditions": true,
13072
"identical_contents": true,
13173
"identical_form_names": true,
74+
"identical_descriptions": false,
13275
"if_in_if": true,
13376
"implement_methods": true,
13477
"in_statement_indentation": false,
13578
"indentation": false,
13679
"inline_data_old_versions": true,
137-
"keep_single_parameter_on_one_line": false,
138-
"keyword_case": false,
139-
"line_break_multiple_parameters": false,
80+
"intf_referencing_clas": {
81+
"severity": "Warning"
82+
},
83+
"keep_single_parameter_on_one_line": true,
84+
"line_break_multiple_parameters": true,
14085
"line_break_style": true,
14186
"line_length": false,
14287
"line_only_punc": false,
14388
"local_class_naming": false,
14489
"local_testclass_location": true,
14590
"local_variable_names": false,
14691
"main_file_contents": true,
147-
"many_parenthesis": false,
92+
"many_parenthesis": true,
93+
"max_one_method_parameter_per_line": true,
94+
"method_implemented_twice": true,
14895
"max_one_statement": true,
14996
"message_exists": true,
15097
"method_length": false,
151-
"method_overwrites_builtin": false,
98+
"method_overwrites_builtin": true,
15299
"method_parameter_names": false,
153-
"mix_returning": false,
100+
"mix_returning": true,
101+
"modify_only_own_db_tables": false,
154102
"msag_consistency": true,
155-
"nesting": false,
103+
"nesting": true,
156104
"names_no_dash": true,
157-
"newline_between_methods": {
158-
"exclude": [],
159-
"severity": "Error",
160-
"count": 3,
161-
"logic": "less"
162-
},
105+
"newline_between_methods": true,
163106
"no_public_attributes": false,
107+
"no_yoda_conditions": false,
164108
"object_naming": false,
165-
"obsolete_statement": {
166-
"exclude": [],
167-
"severity": "Error",
168-
"refresh": true,
169-
"compute": true,
170-
"add": false,
171-
"subtract": false,
172-
"multiply": true,
173-
"move": true,
174-
"divide": true,
175-
"requested": true,
176-
"occurs": true,
177-
"setExtended": true,
178-
"withHeaderLine": true,
179-
"fieldSymbolStructure": true,
180-
"typePools": true,
181-
"load": true
182-
},
183-
"omit_parameter_name": false,
109+
"obsolete_statement": true,
110+
"omit_parameter_name": true,
184111
"omit_receiving": true,
112+
"parser_702_chaining": false,
185113
"parser_error": true,
186114
"parser_missing_space": true,
187115
"prefer_inline": false,
188-
"prefer_is_not": false,
116+
"prefer_is_not": true,
117+
"prefer_raise_exception_new": true,
189118
"prefer_returning_to_exporting": true,
190119
"prefer_xsdbool": true,
191-
"preferred_compare_operator": false,
192-
"prefix_is_current_class": false,
120+
"preferred_compare_operator": true,
121+
"prefix_is_current_class": true,
193122
"reduce_string_templates": true,
194123
"release_idoc": true,
195124
"remove_descriptions": false,
196-
"rfc_error_handling": false,
197-
"selection_screen_naming": {
198-
"exclude": [],
199-
"severity": "Error",
200-
"patternKind": "required",
201-
"ignoreNames": [],
202-
"ignorePatterns": [],
203-
"parameter": "^P_.+$",
204-
"selectOption": "^S_.+$"
205-
},
206-
"sequential_blank": false,
207-
"short_case": {
208-
"exclude": [],
209-
"severity": "Error",
210-
"length": 1,
211-
"allow": []
125+
"rfc_error_handling": true,
126+
"select_add_order_by": false,
127+
"select_performance": {
128+
"severity": "Warning"
212129
},
130+
"selection_screen_naming": false,
131+
"sequential_blank": true,
132+
"short_case": true,
213133
"sicf_consistency": true,
214134
"space_before_colon": true,
215-
"space_before_dot": {
216-
"exclude": [],
217-
"severity": "Error",
218-
"ignoreGlobalDefinition": true,
219-
"ignoreExceptions": true
135+
"space_before_dot": true,
136+
"sql_escape_host_variables": {
137+
"severity": "Warning"
220138
},
221-
"sql_escape_host_variables": false,
222-
"start_at_tab": false,
139+
"start_at_tab": true,
223140
"superclass_final": true,
224141
"sy_modification": true,
225142
"tabl_enhancement_category": true,
226143
"try_without_catch": true,
227144
"type_form_parameters": true,
228145
"types_naming": false,
146+
"uncaught_exception": false,
229147
"unknown_types": true,
230148
"unreachable_code": true,
231-
"unused_methods": false,
149+
"unsecure_fae": false,
150+
"unused_methods": true,
232151
"unused_types": true,
233-
"unused_variables": false,
152+
"unused_variables": {
153+
"severity": "Warning"
154+
},
234155
"use_bool_expression": true,
235-
"use_line_exists": false,
156+
"use_class_based_exceptions": true,
157+
"use_line_exists": true,
236158
"use_new": true,
237159
"when_others_last": true,
238160
"whitespace_end": true,
239-
"xml_consistency": true
161+
"xml_consistency": true,
162+
"keyword_case": false
240163
}
241164
}

src/categories/y_category_code_pal.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CLASS Y_CATEGORY_CODE_PAL IMPLEMENTATION.
2222

2323
METHOD constructor.
2424
super->constructor( ).
25-
description = get_class_description( ).
25+
description = get_class_description( ).
2626
category = 'CL_CI_CATEGORY_TOP'.
2727
position = '001'.
2828
ENDMETHOD.

src/checks/y_check_check_stmnt_position.clas.abap

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ CLASS y_check_check_stmnt_position IMPLEMENTATION.
5959

6060

6161
METHOD is_not_relevant_token.
62-
result = xsdbool( token EQ 'METHOD'
63-
OR token EQ 'FORM'
64-
OR token EQ 'FUNCTION'
65-
OR token EQ 'MODULE'
66-
OR token EQ 'DATA'
67-
OR token EQ 'TYPES'
68-
OR token EQ 'CHECK'
69-
OR token EQ 'FIELD-SYMBOLS'
70-
OR token EQ 'CONSTANTS' ).
62+
result = xsdbool( token = 'METHOD'
63+
OR token = 'FORM'
64+
OR token = 'FUNCTION'
65+
OR token = 'MODULE'
66+
OR token = 'DATA'
67+
OR token = 'TYPES'
68+
OR token = 'CHECK'
69+
OR token = 'FIELD-SYMBOLS'
70+
OR token = 'CONSTANTS' ).
7171
ENDMETHOD.
7272

7373

src/checks/y_check_comment_position.clas.abap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ CLASS y_check_comment_position DEFINITION PUBLIC INHERITING FROM y_check_base CR
99
METHODS has_wrong_position IMPORTING statement TYPE sstmnt
1010
RETURNING VALUE(result) TYPE abap_bool.
1111

12-
METHODS get_first_character IMPORTING token TYPE stokesx
13-
RETURNING VALUE(result) TYPE char1.
14-
1512
METHODS is_pseudo_comment IMPORTING token TYPE stokesx
1613
RETURNING VALUE(result) TYPE abap_bool.
1714

@@ -102,15 +99,6 @@ CLASS Y_CHECK_COMMENT_POSITION IMPLEMENTATION.
10299
ENDMETHOD.
103100

104101

105-
METHOD get_first_character.
106-
TRY.
107-
result = token-str(1).
108-
CATCH cx_sy_range_out_of_bounds.
109-
CLEAR result.
110-
ENDTRY.
111-
ENDMETHOD.
112-
113-
114102
METHOD is_pseudo_comment.
115103
TRY.
116104
result = xsdbool( token-str(4) = '"#EC' ).

0 commit comments

Comments
 (0)