Skip to content

Commit 4f6936f

Browse files
lucasborinLucas Borin
andauthored
1.16.3 (#529)
* updating changelog * new version * Removing Service (#530) * solves #524 * changelog * removing it from the documentation Co-authored-by: Lucas Borin <[email protected]> * Refactoring Function Check (#531) * fixes #526 * changelog * Start statement at tab position Co-authored-by: Lucas Borin <[email protected]> * SUT Dependency (#533) * forcing cspell to track sut dependencies * changelog * fixing #527 Co-authored-by: Lucas Borin <[email protected]> * changelog Co-authored-by: Lucas Borin <[email protected]>
1 parent c782c26 commit 4f6936f

10 files changed

+49
-356
lines changed

.cspell.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
// This is useful for offensive words and common spelling errors.
5959
// For example "hte" should be "the"
6060
"flagWords": [
61-
"hte"
61+
"hte",
62+
"SUT",
63+
"sut"
6264
]
6365
}

changelog.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Legend
1616
+ : added
1717
- : removed
1818

19+
2021-11-11 v.1.16.3
20+
------------------
21+
* Incompatibility with abapGit after commit dc4b3705216757c7533f5802d51 (#528)
22+
* Unit test WITHOUT_ISSUE in Y_CHECK_COMMENT_USAGE fails (#527)
23+
* Refactoring Function Check (#531)
24+
* Unit test RFC_ENABLED in Y_CHECK_FUNCTION fails (#526)
25+
- Remove static dependency to developer version of abapGit (#524)
26+
1927
2021-11-05 v.1.16.2
2028
------------------
2129
* Comment Position when Line Contains Pseudo Comment (#516)

pages/how-to-configure.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,6 @@ You can import and export a Profile with its Delegates and Checks using a `JSON`
8282

8383
![import and export feature](imgs/import-export-feature.png)
8484

85-
### Import via API
86-
87-
Once you export a profile to a `JSON` file, you can import it using the service created in the [How To Install](how-to-install.md) guide.
88-
89-
To consume the API, you have to `POST` the `JSON` file to the service with the respective authentication you configured to the service (usually basic, user/pass) and with the headers `Content-Type` as `application/json` and `action` as `import_profile`.
90-
91-
Possible returns:
92-
93-
- `HTTP 400 - Bad Request` if the file format is not valid, or if the request has a wrong `Content-Type`;
94-
- `HTTP 403 - Forbidden` if the profile already exists in the system and the authentication user is not listed as a delegate;
95-
- `HTTP 500 - Internal Server Error` if the functionality is not working as expected.
96-
9785
### Add / Remove All Checks
9886

9987
You can add all and remove all the Checks from a Profile, here:

pages/how-to-install.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,4 @@ It requires you to set the ABAP Test Cockpit (ATC) to run in Code Inspector mode
2929

3030
Start the transaction `SU3`, and add/set the user parameter `SATC_CI_MODE` to `X`:
3131

32-
![user parameter](imgs/user-parameter.png)
33-
34-
### 5. Service
35-
36-
> :warning: Optional Feature!
37-
38-
Start the transaction `SICF`, and create a service using the `Y_CODE_PAL_SERVICE` handler. Use procedure `Standard`, set the security session to `Completely Restricted` and check the `Use all logon procedures`.
39-
40-
The client, user, and password will be empty as to will provide the authentication when you consume the API.
32+
![user parameter](imgs/user-parameter.png)

src/checks/y_check_comment_usage.clas.testclasses.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ CLASS ltc_pragma IMPLEMENTATION.
225225
( 'REPORT y_example. ' )
226226
( ' START-OF-SELECTION.' )
227227
( ' FORM example.' )
228-
( | CONSTANTS mc_last_counter_values_synch TYPE sut_settings-name VALUE 'LAST_VALUES_SYNCH' ##NO_TEXT. | )
228+
( | CONSTANTS mc_last_counter_values_synch TYPE string VALUE 'LAST_VALUES_SYNCH' ##NO_TEXT. | )
229229
( | CONSTANTS pragma_identifier VALUE '##'. | )
230230
( ' ENDFORM.' )
231231
).

src/checks/y_check_function.clas.abap

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ CLASS y_check_function DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUB
66
METHODS inspect_tokens REDEFINITION.
77

88
PRIVATE SECTION.
9-
METHODS is_rfc_enabled IMPORTING name TYPE rs38l_fnam
10-
RETURNING VALUE(result) TYPE abap_bool.
9+
METHODS is_normal_mode RETURNING VALUE(result) TYPE abap_bool.
1110

1211
ENDCLASS.
1312

1413

1514

16-
CLASS Y_CHECK_FUNCTION IMPLEMENTATION.
17-
15+
CLASS y_check_function IMPLEMENTATION.
1816

1917
METHOD constructor.
2018
super->constructor( ).
@@ -32,17 +30,8 @@ CLASS Y_CHECK_FUNCTION IMPLEMENTATION.
3230

3331

3432
METHOD inspect_tokens.
35-
CHECK statement-type <> scan_stmnt_type-comment.
36-
CHECK statement-type <> scan_stmnt_type-comment_in_stmnt.
37-
CHECK statement-type <> scan_stmnt_type-pragma.
38-
39-
CHECK get_token_abs( statement-from ) = 'FUNCTION'.
40-
41-
DATA(fm_name) = get_token_abs( statement-from + 1 ).
42-
43-
IF is_rfc_enabled( CONV #( fm_name ) ) = abap_true.
44-
RETURN.
45-
ENDIF.
33+
CHECK keyword( ) = if_kaizen_keywords_c=>gc_function.
34+
CHECK is_normal_mode( ) = abap_true.
4635

4736
DATA(check_configuration) = detect_check_configuration( statement ).
4837

@@ -53,12 +42,10 @@ CLASS Y_CHECK_FUNCTION IMPLEMENTATION.
5342
ENDMETHOD.
5443

5544

56-
METHOD is_rfc_enabled.
57-
SELECT SINGLE @abap_true
58-
FROM tfdir
59-
INTO @result
60-
WHERE funcname = @name
61-
AND fmode = 'R'.
45+
METHOD is_normal_mode.
46+
DATA(function_module) = next1( CONV #( if_kaizen_keywords_c=>gc_function ) ).
47+
SELECT SINGLE pname INTO @DATA(function_group) FROM tfdir WHERE funcname = @function_module AND fmode = @space.
48+
result = xsdbool( sy-subrc = 0 ).
6249
ENDMETHOD.
6350

6451
ENDCLASS.

src/checks/y_check_function.clas.testclasses.abap

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,44 @@ CLASS lth_function DEFINITION.
22
PROTECTED SECTION.
33
DATA cut TYPE REF TO ltd_check_function.
44

5-
METHODS given_rfc_enabled.
6-
METHODS given_rfc_disabled.
5+
METHODS given_function_group.
76
METHODS when_run.
8-
METHODS then_has_issue.
9-
METHODS then_no_issue.
7+
METHODS then_finds.
8+
9+
PRIVATE SECTION.
10+
DATA expected_issues TYPE i.
1011

1112
ENDCLASS.
1213

1314

1415
CLASS lth_function IMPLEMENTATION.
1516

16-
METHOD given_rfc_enabled.
17-
SELECT SINGLE pname FROM tfdir INTO @DATA(function_group) WHERE fmode = 'R'.
18-
cut->set_ref_scan( y_code_pal_ref_scan_double=>get_from_fuction_group( function_group ) ).
19-
ENDMETHOD.
17+
METHOD given_function_group.
18+
" Get one that has RFC enabled and disabled
19+
SELECT SINGLE tfdir~pname
20+
FROM tfdir AS tfdir
21+
INNER JOIN tfdir AS enabled ON enabled~pname = tfdir~pname
22+
AND enabled~fmode <> @space
23+
WHERE tfdir~fmode = @space
24+
INTO @DATA(function_group).
25+
26+
SELECT COUNT( * )
27+
FROM tfdir
28+
WHERE pname = @function_group
29+
AND tfdir~fmode = @space
30+
INTO @expected_issues.
2031

21-
METHOD given_rfc_disabled.
22-
SELECT SINGLE pname FROM tfdir INTO @DATA(function_group) WHERE fmode = 'X'.
2332
cut->set_ref_scan( y_code_pal_ref_scan_double=>get_from_fuction_group( function_group ) ).
2433
ENDMETHOD.
2534

2635
METHOD when_run.
2736
cut->run( ).
2837
ENDMETHOD.
2938

30-
METHOD then_no_issue.
31-
cl_abap_unit_assert=>assert_initial( act = cut->get_statistics( )->count-errors
32-
quit = if_aunit_constants=>quit-no ).
33-
cl_abap_unit_assert=>assert_initial( act = cut->get_statistics( )->count-warnings
34-
quit = if_aunit_constants=>quit-no ).
35-
cl_abap_unit_assert=>assert_initial( act = cut->get_statistics( )->count-notes
36-
quit = if_aunit_constants=>quit-no ).
37-
cl_abap_unit_assert=>assert_initial( act = cut->get_statistics( )->count-pseudo_comments
38-
quit = if_aunit_constants=>quit-no ).
39-
ENDMETHOD.
40-
41-
METHOD then_has_issue.
42-
cl_abap_unit_assert=>assert_not_initial( act = cut->get_statistics( )->count-notes
43-
quit = if_aunit_constants=>quit-no ).
44-
39+
METHOD then_finds.
40+
cl_abap_unit_assert=>assert_equals( act = cut->get_statistics( )->count-notes
41+
exp = expected_issues
42+
quit = if_aunit_constants=>quit-no ).
4543
cl_abap_unit_assert=>assert_initial( act = cut->get_statistics( )->count-errors
4644
quit = if_aunit_constants=>quit-no ).
4745
cl_abap_unit_assert=>assert_initial( act = cut->get_statistics( )->count-warnings
@@ -56,8 +54,7 @@ ENDCLASS.
5654

5755
CLASS ltc_function DEFINITION FOR TESTING INHERITING FROM lth_function RISK LEVEL HARMLESS.
5856
PUBLIC SECTION.
59-
METHODS rfc_enabled FOR TESTING.
60-
METHODS rfc_disabled FOR TESTING.
57+
METHODS test FOR TESTING.
6158

6259
PRIVATE SECTION.
6360
METHODS setup.
@@ -71,16 +68,10 @@ CLASS ltc_function IMPLEMENTATION.
7168
cut = NEW #( ).
7269
ENDMETHOD.
7370

74-
METHOD rfc_enabled.
75-
given_rfc_enabled( ).
76-
when_run( ).
77-
then_no_issue( ).
78-
ENDMETHOD.
79-
80-
METHOD rfc_disabled.
81-
given_rfc_disabled( ).
71+
METHOD test.
72+
given_function_group( ).
8273
when_run( ).
83-
then_has_issue( ).
74+
then_finds( ).
8475
ENDMETHOD.
8576

8677
ENDCLASS.

0 commit comments

Comments
 (0)