Skip to content

Commit e8552da

Browse files
authored
Allow Exemptions (#453)
* big refactoring * isolating unit tests * changelog * forcing commit * forcing commit
1 parent e29a190 commit e8552da

File tree

63 files changed

+301
-489
lines changed

Some content is hidden

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

63 files changed

+301
-489
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Whenever you upgrade code pal for ABAP, it is highly recommended to execute the
1414

1515
2021-08-XX v.1.16.0
1616
------------------
17+
* Profiles: Allow Exemptions (#447)
1718
* BAdI example class vs Percentage Comment (#443)
1819
* Unit-Test Assert Validator (#450)
1920
+ Prefer Pragmas to Pseudo Comments (#421)

src/checks/y_check_boolean_input_param.clas.abap

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,10 @@ CLASS y_check_boolean_input_param IMPLEMENTATION.
4040

4141
DATA(configuration) = detect_check_configuration( statement ).
4242

43-
IF configuration IS INITIAL.
44-
RETURN.
45-
ENDIF.
46-
4743
raise_error( statement_level = statement-level
4844
statement_index = index
49-
statement_from = statement-from
50-
error_priority = configuration-prio ).
45+
statement_from = statement-from
46+
check_configuration = configuration ).
5147

5248
ENDMETHOD.
5349

src/checks/y_check_branch_coverage.clas.abap

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ CLASS y_check_branch_coverage IMPLEMENTATION.
4545
DATA(check_configuration) = detect_check_configuration( error_count = CONV #( branch )
4646
statement = VALUE #( level = 1 ) ).
4747

48-
IF check_configuration IS INITIAL.
49-
RETURN.
50-
ENDIF.
51-
5248
raise_error( statement_level = 1
5349
statement_index = 1
5450
statement_from = 1
55-
error_priority = check_configuration-prio
51+
check_configuration = check_configuration
5652
parameter_01 = |{ branch }|
5753
parameter_02 = |{ check_configuration-threshold }|
5854
parameter_03 = |{ coverage->get_total( ) }|

src/checks/y_check_call_method_usage.clas.abap

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@ CLASS y_check_call_method_usage IMPLEMENTATION.
3535
OR token CP '*)=>*'
3636
OR token CP '(*)' ).
3737

38-
DATA(check_configuration) = detect_check_configuration( statement ).
39-
40-
IF check_configuration IS NOT INITIAL
41-
AND has_keyword = abap_true
42-
AND is_dynamic = abap_false.
43-
44-
raise_error( statement_level = statement-level
45-
statement_index = index
46-
statement_from = statement-from
47-
error_priority = check_configuration-prio ).
38+
IF has_keyword = abap_true
39+
AND is_dynamic = abap_false.
40+
DATA(check_configuration) = detect_check_configuration( statement ).
41+
42+
raise_error( statement_level = statement-level
43+
statement_index = index
44+
statement_from = statement-from
45+
check_configuration = check_configuration ).
4846
ENDIF.
4947
ENDMETHOD.
5048

src/checks/y_check_chain_decl_usage.clas.abap

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,10 @@ CLASS Y_CHECK_CHAIN_DECL_USAGE IMPLEMENTATION.
4040

4141
DATA(configuration) = detect_check_configuration( statement ).
4242

43-
IF configuration IS INITIAL.
44-
RETURN.
45-
ENDIF.
46-
47-
raise_error( statement_level = statement-level
48-
statement_index = index
49-
statement_from = statement-from
50-
error_priority = configuration-prio ).
43+
raise_error( statement_level = statement-level
44+
statement_index = index
45+
statement_from = statement-from
46+
check_configuration = configuration ).
5147

5248
ENDMETHOD.
5349

src/checks/y_check_check_in_loop.clas.abap

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ CLASS y_check_check_in_loop IMPLEMENTATION.
3737

3838
DATA(check_configuration) = detect_check_configuration( statement ).
3939

40-
IF check_configuration IS INITIAL.
41-
RETURN.
42-
ENDIF.
43-
44-
raise_error( statement_level = statement-level
45-
statement_index = index
46-
statement_from = statement-from
47-
error_priority = check_configuration-prio ).
40+
raise_error( statement_level = statement-level
41+
statement_index = index
42+
statement_from = statement-from
43+
check_configuration = check_configuration ).
4844
ENDMETHOD.
4945

5046

src/checks/y_check_check_stmnt_position.clas.abap

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,10 @@ CLASS y_check_check_stmnt_position IMPLEMENTATION.
4747

4848
DATA(check_configuration) = detect_check_configuration( statement ).
4949

50-
IF check_configuration IS INITIAL.
51-
RETURN.
52-
ENDIF.
53-
54-
raise_error( statement_level = statement-level
55-
statement_index = index
56-
statement_from = statement-from
57-
error_priority = check_configuration-prio ).
50+
raise_error( statement_level = statement-level
51+
statement_index = index
52+
statement_from = statement-from
53+
check_configuration = check_configuration ).
5854
ENDMETHOD.
5955

6056

src/checks/y_check_collect.clas.abap

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,12 @@ CLASS y_check_collect IMPLEMENTATION.
8282
ENDIF.
8383
ENDIF.
8484

85-
DATA(configuration) = detect_check_configuration( statement ).
85+
DATA(check_configuration) = detect_check_configuration( statement ).
8686

87-
IF configuration IS INITIAL.
88-
RETURN.
89-
ENDIF.
90-
91-
raise_error( statement_level = statement-level
92-
statement_index = index
93-
statement_from = statement-from
94-
error_priority = configuration-prio ).
87+
raise_error( statement_level = statement-level
88+
statement_index = index
89+
statement_from = statement-from
90+
check_configuration = check_configuration ).
9591
ENDMETHOD.
9692

9793

src/checks/y_check_comment_position.clas.abap

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,12 @@ CLASS y_check_comment_position IMPLEMENTATION.
4545
CHECK statement-type = 'P'.
4646
CHECK has_wrong_position( statement ).
4747

48-
DATA(configuration) = detect_check_configuration( statement ).
49-
50-
IF configuration IS INITIAL.
51-
RETURN.
52-
ENDIF.
48+
DATA(check_configuration) = detect_check_configuration( statement ).
5349

5450
raise_error( statement_level = statement-level
5551
statement_index = index
5652
statement_from = statement-from
57-
error_priority = configuration-prio ).
58-
53+
check_configuration = check_configuration ).
5954
ENDMETHOD.
6055

6156

src/checks/y_check_comment_type.clas.abap

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,12 @@ CLASS y_check_comment_type IMPLEMENTATION.
3030
CHECK statement-type = 'P'.
3131
CHECK has_wrong_comment_type( statement ).
3232

33-
DATA(configuration) = detect_check_configuration( statement ).
34-
35-
IF configuration IS INITIAL.
36-
RETURN.
37-
ENDIF.
33+
DATA(check_configuration) = detect_check_configuration( statement ).
3834

3935
raise_error( statement_level = statement-level
4036
statement_index = index
4137
statement_from = statement-from
42-
error_priority = configuration-prio ).
43-
38+
check_configuration = check_configuration ).
4439
ENDMETHOD.
4540

4641

0 commit comments

Comments
 (0)