Skip to content

New abapLint Rules #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 76 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
e25fb47
Update abaplint.json
lucasborin Jan 12, 2021
f56c4f0
Update abaplint.json
lucasborin Jan 12, 2021
9ba9727
Merge branch 'master' into abaplint_keyword_case
lucasborin Feb 24, 2021
c3ac998
Merge branch 'master' into abaplint_keyword_case
Mar 24, 2021
3b487be
Merge branch '1.14.0' into abaplint_keyword_case
lucasborin Apr 5, 2021
5c2204a
Update abaplint.json
lucasborin Apr 6, 2021
e79df21
Update abaplint.json
lucasborin Apr 6, 2021
e9b2db6
Merge branch '1.14.0' into abaplint_keyword_case
lucasborin Apr 6, 2021
70ab5ca
disabling empty_line_in_statement
lucasborin Apr 6, 2021
ae7067c
Remove double space
lucasborin Apr 6, 2021
67eaa0a
disabling exit_or_check
lucasborin Apr 6, 2021
5274088
disabling line_only_punc
lucasborin Apr 6, 2021
3aa5593
Update abaplint.json
lucasborin Apr 6, 2021
2ce5368
Update abaplint.json
lucasborin Apr 6, 2021
521b595
Compare operator "EQ" not preferred
lucasborin Apr 6, 2021
78a7828
Disabling no_yoda_conditions
lucasborin Apr 6, 2021
685301c
Method "get_first_character" not used
lucasborin Apr 6, 2021
5f92bd2
Compare operator "EQ" not preferred
lucasborin Apr 6, 2021
eb5dbba
Keep single parameter on one line
lucasborin Apr 6, 2021
3d36508
Statement "ADD" is obsolete
lucasborin Apr 6, 2021
9b527a1
Compare operator "GE" not preferred
lucasborin Apr 6, 2021
89b2033
Compare operator "GE" not preferred
lucasborin Apr 6, 2021
d8b87cd
Compare operator "EQ" not preferred
lucasborin Apr 6, 2021
957c86e
Avoid use of SELECT *
lucasborin Apr 6, 2021
10d3fe4
Uncaught exception cx_sy_itab_line_not_found
lucasborin Apr 6, 2021
ff7dad8
Compare operator "EQ", "LT, "GT" not preferred
lucasborin Apr 6, 2021
74bf8bf
Reorder definitions to top of routine
lucasborin Apr 6, 2021
b70c04a
Too many parenthesis, simple
lucasborin Apr 6, 2021
278db7b
Prefer Inline Declarations, CHECK_CONFIGURATION
lucasborin Apr 6, 2021
199ed5a
Missing space between string or character literal
lucasborin Apr 6, 2021
7e681ec
wrongly commited object
lucasborin Apr 6, 2021
17ec8ec
Some fixes
lucasborin Apr 6, 2021
b298105
Statement "ADD" is obsolete
lucasborin Apr 6, 2021
73956d4
Compare operator "EQ" not preferred
lucasborin Apr 6, 2021
bd3ebdc
Some fixes
lucasborin Apr 6, 2021
edc0575
Some fixes
lucasborin Apr 6, 2021
c72be23
Some fixes
lucasborin Apr 6, 2021
657c675
ops, fixing bug
lucasborin Apr 6, 2021
2b38ee1
Compare operator "EQ" not preferred
lucasborin Apr 6, 2021
06a5aed
Statement "ADD" is obsolete
lucasborin Apr 6, 2021
b636618
Some fixes
lucasborin Apr 6, 2021
dcc6714
Some fixes
lucasborin Apr 6, 2021
27bdd75
several fixes
lucasborin Apr 6, 2021
6484bbc
Update y_check_unit_test_assert.clas.abap
Apr 7, 2021
0e255c3
Merge branch '1.14.0' into abaplint_keyword_case
lucasborin Apr 7, 2021
69500cb
Update abaplint.json
lucasborin Apr 7, 2021
5ed7524
Update abaplint.json
lucasborin Apr 7, 2021
25afef9
Update abaplint.json
lucasborin Apr 7, 2021
72a662c
Several fixes
lucasborin Apr 7, 2021
3e4fb87
Merge branch '1.14.0' into abaplint_keyword_case
lucasborin Apr 7, 2021
f529f29
several fixes
lucasborin Apr 7, 2021
739e41e
SEVERAL FIXES
lucasborin Apr 7, 2021
d266c60
Update abaplint.json
lucasborin Apr 7, 2021
a87a778
Update abaplint.json
lucasborin Apr 7, 2021
9587582
several fixes
lucasborin Apr 7, 2021
6dc1ea5
Update abaplint.json
lucasborin Apr 7, 2021
0ad29f8
Update abaplint.json
lucasborin Apr 7, 2021
c82c70f
Update abaplint.json
lucasborin Apr 7, 2021
73035f1
Update abaplint.json
lucasborin Apr 7, 2021
ce57aab
a few fixes
lucasborin Apr 7, 2021
5b8a173
Update abaplint.json
lucasborin Apr 7, 2021
22f9dad
several fixes
lucasborin Apr 7, 2021
67e72e2
Update abaplint.json
lucasborin Apr 7, 2021
e862773
several fixes
lucasborin Apr 7, 2021
3eea8a9
Update abaplint.json
lucasborin Apr 7, 2021
01cf693
a few fixes
lucasborin Apr 7, 2021
67e78fe
Update abaplint.json
lucasborin Apr 7, 2021
00aeb08
Update y_exemption_general.clas.abap
lucasborin Apr 7, 2021
af503be
Update y_test_code_detector.clas.abap
lucasborin Apr 7, 2021
069fef5
Update y_check_empty_catches.clas.abap
lucasborin Apr 7, 2021
0674354
Don't mix RETURNING and EXPORTING/CHANGING paramet
lucasborin Apr 7, 2021
f07faa4
Update abaplint.json
lucasborin Apr 8, 2021
841e17d
Update abaplint.json
lucasborin Apr 8, 2021
868253b
Merge branch '1.14.0' into abaplint_keyword_case
lucasborin Apr 8, 2021
ae6e369
Update abaplint.json
lucasborin Apr 8, 2021
e44e8f7
Merge branch '1.14.0' into abaplint_keyword_case
lucasborin Apr 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 65 additions & 142 deletions abaplint.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,230 +12,153 @@
"url": "https://github.com/abaplint/deps",
"folder": "/deps1",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abapGit/abapGit",
"folder": "/deps2",
"files": "/src/**/*.*"
}
],
"syntax": {
"version": "v740sp08",
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
"errorNamespace": "^(Y)",
"globalConstants": ["cntb_btype_button", "scan_struc_stmnt_type", "scan_stmnt_type", "scan_struc_type", "scan_token_type"],
"globalMacros": []
},
"rules": {
"7bit_ascii": true,
"abapdoc": false,
"allowed_object_naming": true,
"allowed_object_types": {
"exclude": [],
"severity": "Error",
"allowed": []
},
"allowed_object_types": false,
"ambiguous_statement": false,
"avoid_use": {
"exclude": [],
"severity": "Error",
"define": true,
"endselect": true,
"execSQL": true,
"kernelCall": true,
"communication": true,
"statics": true,
"systemCall": true,
"defaultKey": false,
"break": false,
"describeLines": false
},
"avoid_use": false,
"begin_end_names": true,
"begin_single_include": true,
"call_transaction_authority_check": true,
"chain_mainly_declarations": {
"exclude": [],
"severity": "Error",
"definitions": true,
"write": true,
"move": true,
"refresh": true,
"unassign": true,
"clear": true,
"hide": true,
"free": true,
"include": true,
"check": true
},
"call_transaction_authority_check": false,
"chain_mainly_declarations": true,
"check_abstract": true,
"check_comments": false,
"check_ddic": true,
"check_ddic": false,
"check_include": true,
"check_no_handler_pragma": true,
"check_subrc": false,
"check_syntax": true,
"check_text_elements": false,
"check_transformation_exists": true,
"check_transformation_exists": false,
"class_attribute_names": false,
"cloud_types": true,
"colon_missing_space": true,
"commented_code": false,
"commented_code": true,
"constructor_visibility_public": true,
"contains_tab": false,
"cyclomatic_complexity": {
"exclude": [],
"severity": "Error",
"max": 20
},
"definitions_top": false,
"cyclomatic_complexity": true,
"dangerous_statement": true,
"db_operation_in_loop": false,
"definitions_top": true,
"description_empty": true,
"double_space": false,
"double_space": {
"startParen": false
},
"downport": true,
"empty_line_in_statement": false,
"empty_statement": true,
"empty_structure": false,
"empty_structure": true,
"exit_or_check": false,
"exporting": false,
"forbidden_identifier": {
"exclude": [],
"severity": "Error",
"check": []
},
"forbidden_pseudo_and_pragma": {
"exclude": [],
"severity": "Error",
"pseudo": [],
"pragmas": [],
"ignoreGlobalClassDefinition": false,
"ignoreGlobalInterface": false
},
"forbidden_void_type": {
"exclude": [],
"severity": "Error",
"check": []
},
"exporting": true,
"forbidden_identifier": false,
"forbidden_pseudo_and_pragma": false,
"forbidden_void_type": false,
"form_tables_obsolete": true,
"fully_type_constants": {
"exclude": [],
"severity": "Error",
"checkData": true
},
"fully_type_constants": false,
"function_module_recommendations": true,
"functional_writing": {
"exclude": [],
"severity": "Error",
"ignoreExceptions": true
},
"functional_writing": true,
"global_class": true,
"identical_conditions": true,
"identical_contents": true,
"identical_form_names": true,
"identical_descriptions": false,
"if_in_if": true,
"implement_methods": true,
"in_statement_indentation": false,
"indentation": false,
"inline_data_old_versions": true,
"keep_single_parameter_on_one_line": false,
"keyword_case": false,
"line_break_multiple_parameters": false,
"intf_referencing_clas": {
"severity": "Warning"
},
"keep_single_parameter_on_one_line": true,
"line_break_multiple_parameters": true,
"line_break_style": true,
"line_length": false,
"line_only_punc": false,
"local_class_naming": false,
"local_testclass_location": true,
"local_variable_names": false,
"main_file_contents": true,
"many_parenthesis": false,
"many_parenthesis": true,
"max_one_method_parameter_per_line": true,
"method_implemented_twice": true,
"max_one_statement": true,
"message_exists": true,
"method_length": false,
"method_overwrites_builtin": false,
"method_overwrites_builtin": true,
"method_parameter_names": false,
"mix_returning": false,
"mix_returning": true,
"modify_only_own_db_tables": false,
"msag_consistency": true,
"nesting": false,
"nesting": true,
"names_no_dash": true,
"newline_between_methods": {
"exclude": [],
"severity": "Error",
"count": 3,
"logic": "less"
},
"newline_between_methods": true,
"no_public_attributes": false,
"no_yoda_conditions": false,
"object_naming": false,
"obsolete_statement": {
"exclude": [],
"severity": "Error",
"refresh": true,
"compute": true,
"add": false,
"subtract": false,
"multiply": true,
"move": true,
"divide": true,
"requested": true,
"occurs": true,
"setExtended": true,
"withHeaderLine": true,
"fieldSymbolStructure": true,
"typePools": true,
"load": true
},
"omit_parameter_name": false,
"obsolete_statement": true,
"omit_parameter_name": true,
"omit_receiving": true,
"parser_702_chaining": false,
"parser_error": true,
"parser_missing_space": true,
"prefer_inline": false,
"prefer_is_not": false,
"prefer_is_not": true,
"prefer_raise_exception_new": true,
"prefer_returning_to_exporting": true,
"prefer_xsdbool": true,
"preferred_compare_operator": false,
"prefix_is_current_class": false,
"preferred_compare_operator": true,
"prefix_is_current_class": true,
"reduce_string_templates": true,
"release_idoc": true,
"remove_descriptions": false,
"rfc_error_handling": false,
"selection_screen_naming": {
"exclude": [],
"severity": "Error",
"patternKind": "required",
"ignoreNames": [],
"ignorePatterns": [],
"parameter": "^P_.+$",
"selectOption": "^S_.+$"
},
"sequential_blank": false,
"short_case": {
"exclude": [],
"severity": "Error",
"length": 1,
"allow": []
"rfc_error_handling": true,
"select_add_order_by": false,
"select_performance": {
"severity": "Warning"
},
"selection_screen_naming": false,
"sequential_blank": true,
"short_case": true,
"sicf_consistency": true,
"space_before_colon": true,
"space_before_dot": {
"exclude": [],
"severity": "Error",
"ignoreGlobalDefinition": true,
"ignoreExceptions": true
"space_before_dot": true,
"sql_escape_host_variables": {
"severity": "Warning"
},
"sql_escape_host_variables": false,
"start_at_tab": false,
"start_at_tab": true,
"superclass_final": true,
"sy_modification": true,
"tabl_enhancement_category": true,
"try_without_catch": true,
"type_form_parameters": true,
"types_naming": false,
"uncaught_exception": false,
"unknown_types": true,
"unreachable_code": true,
"unused_methods": false,
"unsecure_fae": false,
"unused_methods": true,
"unused_types": true,
"unused_variables": false,
"unused_variables": {
"severity": "Warning"
},
"use_bool_expression": true,
"use_line_exists": false,
"use_class_based_exceptions": true,
"use_line_exists": true,
"use_new": true,
"when_others_last": true,
"whitespace_end": true,
"xml_consistency": true
"xml_consistency": true,
"keyword_case": false
}
}
2 changes: 1 addition & 1 deletion src/categories/y_category_code_pal.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CLASS Y_CATEGORY_CODE_PAL IMPLEMENTATION.

METHOD constructor.
super->constructor( ).
description = get_class_description( ).
description = get_class_description( ).
category = 'CL_CI_CATEGORY_TOP'.
position = '001'.
ENDMETHOD.
Expand Down
18 changes: 9 additions & 9 deletions src/checks/y_check_check_stmnt_position.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ CLASS y_check_check_stmnt_position IMPLEMENTATION.


METHOD is_not_relevant_token.
result = xsdbool( token EQ 'METHOD'
OR token EQ 'FORM'
OR token EQ 'FUNCTION'
OR token EQ 'MODULE'
OR token EQ 'DATA'
OR token EQ 'TYPES'
OR token EQ 'CHECK'
OR token EQ 'FIELD-SYMBOLS'
OR token EQ 'CONSTANTS' ).
result = xsdbool( token = 'METHOD'
OR token = 'FORM'
OR token = 'FUNCTION'
OR token = 'MODULE'
OR token = 'DATA'
OR token = 'TYPES'
OR token = 'CHECK'
OR token = 'FIELD-SYMBOLS'
OR token = 'CONSTANTS' ).
ENDMETHOD.


Expand Down
12 changes: 0 additions & 12 deletions src/checks/y_check_comment_position.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ CLASS y_check_comment_position DEFINITION PUBLIC INHERITING FROM y_check_base CR
METHODS has_wrong_position IMPORTING statement TYPE sstmnt
RETURNING VALUE(result) TYPE abap_bool.

METHODS get_first_character IMPORTING token TYPE stokesx
RETURNING VALUE(result) TYPE char1.

METHODS is_pseudo_comment IMPORTING token TYPE stokesx
RETURNING VALUE(result) TYPE abap_bool.

Expand Down Expand Up @@ -102,15 +99,6 @@ CLASS Y_CHECK_COMMENT_POSITION IMPLEMENTATION.
ENDMETHOD.


METHOD get_first_character.
TRY.
result = token-str(1).
CATCH cx_sy_range_out_of_bounds.
CLEAR result.
ENDTRY.
ENDMETHOD.


METHOD is_pseudo_comment.
TRY.
result = xsdbool( token-str(4) = '"#EC' ).
Expand Down
Loading