Skip to content

Commit e45ffb4

Browse files
lucasborinEugen Guentherestevao-schultz-neto-SAPEugen Güntherabaplint[bot]
authored
1.14.0 (#345)
* 1.14.0 * fixing version * adding missing checks feature (#346) * adding missing checks feature * minor update Co-authored-by: Eugen Guenther <[email protected]> * Update changelog.txt * Standard Functions in Prefer IS NOT to NOT IS (#353) * solves #338 * Update changelog.txt * contains_any_not_of and contains_any_of * Prefer New to Create Object (#354) * implements #283 * Update check_documentation.md * minor fixes * Create prefer-new-to-create-object.md * Update changelog.txt * Update prefer-new-to-create-object.md * adding example Co-authored-by: estevao-schultz-neto-SAP <[email protected]> * Unit Test Assert Check (#347) * new check * fixing class description * adding demo * comparing token type * Update check_documentation.md * Update check_documentation.md * Create unit_test_assert.md * Update changelog.txt * Update unit_test_assert.md Co-authored-by: estevao-schultz-neto-SAP <[email protected]> * Update y_check_unit_test_assert.clas.abap * Update y_check_unit_test_assert.clas.abap * Part 1 - core feature - allow pseudo comment exception #329 (#357) * feature - allow pseudo comment exception * Update y_check_unit_test_assert.clas.abap Co-authored-by: Lucas Borin <[email protected]> * Revert "Part 1 - core feature - allow pseudo comment exception #329 (#357)" (#358) This reverts commit 4da128b. * fixes #359 (#366) * Update changelog.txt * 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> * Update changelog.txt * Update y_check_base.clas.abap * Update src/foundation/y_check_base.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Update unit_test_assert.md * Feature allow pseudo comment exception (#361) * feature - allow pseudo comment exception * Update y_check_unit_test_assert.clas.abap * update * minor update * requested changes * Update src/profiles/y_profile_admin_classes.prog.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * UX update * abaplint fix * Update y_check_base.clas.abap * Update y_profile_admin_classes.prog.abap * Update y_profile_manager.clas.abap * Update src/profiles/y_profile_admin_classes.prog.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Update y_profile_administrator.prog.xml * Update y_profile_admin_classes.prog.abap * Update y_profile_admin_classes.prog.abap * minor change * abaplint fix * Update y_check_base.clas.abap * update * update * Update y_profile_admin_classes.prog.abap * update * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md * Update changelog.txt Co-authored-by: Eugen Guenther <[email protected]> Co-authored-by: Eugen Günther <[email protected]> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Prefer LINE_EXISTS or LINE_INDEX to READ TABLE or LOOP AT (#355) * implements #286 * Update changelog.txt * Update check_documentation.md * demo + description * Create prefer-line-exists.md * Update y_check_unit_test_assert.clas.abap * fixing from/to * Update y_check_prefer_line_exists.clas.testclasses.abap Co-authored-by: Eugen Günther <[email protected]> * Update changelog.txt * Update abaplint.json (#377) * adjust of ignore pseudocomment on relevant checks (#375) * adjust of ignore pseudocomment on relevant checks * update * update Co-authored-by: Lucas Borin <[email protected]> * changing default severity (#376) * changing default severity * fixing version * c_note * Update README.md * Update README.md * Update how-to-configure.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md * Update changelog.txt * Update README.md * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md * Update how-to-configure.md Co-authored-by: estevao-schultz-neto-SAP <[email protected]> * Update changelog.txt * Update changelog.txt * Update changelog.txt * fixing broken ut Co-authored-by: Eugen Guenther <[email protected]> Co-authored-by: estevao-schultz-neto-SAP <[email protected]> Co-authored-by: Eugen Günther <[email protected]> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
1 parent 0dc6195 commit e45ffb4

File tree

91 files changed

+2170
-1059
lines changed

Some content is hidden

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

91 files changed

+2170
-1059
lines changed

README.md

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
11
# code pal for ABAP
22

3-
[![abap package version](https://img.shields.io/endpoint?url=https://shield.abap.space/version-shield-json/github/SAP/code-pal-for-abap/src/y_code_pal_version.intf.abap/abap&label=version)](https://github.com/SAP/code-pal-for-abap/blob/master/changelog.txt)
3+
[![abap package version](https://img.shields.io/endpoint?url=https://shield.abap.space/version-shield-json/github/SAP/code-pal-for-abap/src/y_code_pal_version.intf.abap/abap&label=version)](changelog.txt)
44
[![license](https://img.shields.io/github/license/SAP/code-pal-for-abap)](LICENSE)
55

6-
This tool supports you in writing a clean ABAP code. Clean Code allows you to read your code like well-written prose, it is easily understandable, maintainable, and extensible. In addition, you can write high quality and reliable Unit Tests without hurdles and thereby reduce the total cost of ownership of the software.
6+
Based on the [Clean ABAP](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md) style guide, this tool contains a set of checks to guarantee the [Clean ABAP](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md) adherence.
7+
Together, we both support you in writing a clean ABAP code.
78

8-
Furthermore... It's **free** and **open-source**!
9+
❣️ It's **free** and **open-source**.
910

10-
It is licensed under the Apache License, Version 2.0 - see [LICENSE](LICENSE).
11-
12-
## News
13-
14-
**:warning: Migration Required :warning:**
15-
16-
From version `v1.01.0` to `v1.02.0` the folder logic was changed, and the abapGit is not able to perform this migration automatically. Therefore, please, follow the step-by-step described in [How To Migrate](pages/how-to-migrate.md)!
11+
## Features
1712

18-
Check the [change log](changelog.txt) for further information.
13+
- Supported by Code Inspector (`SCI` / `SCII`) and ABAP Test Cockpit (ATC) (`SE80` / Eclipse);
14+
- Ignores automatically generated code;
15+
- Supports exemptions;
16+
- Provides a new user-friendly way to create variants ([Profile Management](pages/how-to-configure.md));
17+
- Allows configuration based on:
18+
- Threshold;
19+
- Severity / Priority;
20+
- Validity for productive code, test code, or both;
21+
- Validity for objects created since a specific date;
22+
- Validity period;
23+
- Allow / Deny exemption.
24+
25+
⚠️ Tool is not RFC-Enabled ([#268](https://github.com/SAP/code-pal-for-abap/issues/268)).
1926

20-
## Features
27+
⚠️ Severities set to `Notification` / `Priority 3` by default ([#368](https://github.com/SAP/code-pal-for-abap/issues/368)).
2128

22-
- Checks are ready-to-use;
23-
- Checks can be executed via SUT, SCI, SCII (Code-Inspector) and via ATC (e.g. directly in SE80, Eclipse...);
24-
- Automatic exclusion of code which shall not be checked (e.g. generated code);
25-
- The scope is customizable (filter option on object creation date);
26-
- Thresholds are customizable;
27-
- Message severity is customizable (error, warning, or notification);
28-
- Checking may be activated in productive-code and/or test-code (customizable);
29-
- Findings can be suppressed via Code-Inspector Pragmas;
30-
- Usage of a "Profile Management Tool" (Optional).
31-
32-
The Profile Management Tool, which is an alternative of working with SCI based variant(s), offers among others:
33-
- An user friendly UI;
34-
- A user-based or group-based execution of Checks;
35-
- Creation, assignment and unassignment of Profiles (unassigning a profile will only delete it if no checks are registered to this profile);
36-
- Import/Export a profile among systems (download/upload function – UI button or API Post Service);
37-
- Single-Click registration of all code pal checks at once to a profile (UI button);
38-
- Multiple execution of several profiles at the same time (the sharpest/strongest and time valid configuration/threshold will be taken);
39-
- Delegation principle to facilitate team work (all delegates, for instance: team members, can work with the same profile);
40-
41-
:warning: The checks are not RFC-Enabled due to local dependencies.
42-
43-
## List of Checks
29+
## Set of Checks
4430

4531
- [Check Documentation](docs/check_documentation.md)
4632

@@ -56,11 +42,14 @@ The Profile Management Tool, which is an alternative of working with SCI based v
5642
- **[Execute](pages/how-to-execute.md)**
5743
- **[Contribute](pages/how-to-contribute.md)**
5844

59-
## Further Reading
45+
## Recommended Readings
6046

61-
- [ABAP Styleguides on Clean Code](https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md)
62-
- [Writing Testable Code for ABAP](https://open.sap.com/courses/wtc1/items/2gzG0sRlN1yjkTUREB02L9)
63-
- [ABAP Development for S/4HANA](https://open.sap.com/courses/a4h1)
47+
- [Clean ABAP](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md)
6448
- [ABAP 7.40 Quick Reference](https://blogs.sap.com/2015/10/25/abap-740-quick-reference/)
6549
- [ABAP Built-in Functions](https://blogs.sap.com/2015/11/30/reminder-abap-built-in-functions/)
6650
- [ABAP - Release-Specific Changes](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abennews.htm)
51+
52+
## Recommended Courses
53+
54+
- [Writing Testable Code for ABAP](https://open.sap.com/courses/wtc1/items/2gzG0sRlN1yjkTUREB02L9)
55+
- [ABAP Development for S/4HANA](https://open.sap.com/courses/a4h1)

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+
"allow": ["cl_ci_scan"]
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
}

0 commit comments

Comments
 (0)