Skip to content

"Add missing parameters to ABAPDoc" rules for unit-test methods #103

Closed

Description

@suynwa

I have a minor gripe regarding the rule Add missing parameters to ABAPDoc in the context of aUnit methods.

Before running abapCleaner:

    "! It should not add missing param CX_STATIC_CHECK 
    methods SHOULD_NOT_ADD_ABAP_DOC for testing raising CX_STATIC_CHECK.

After running abapCleaner:

    "! It should not add missing param CX_STATIC_CHECK
    "!
    "! @raising cx_static_check | 
    methods SHOULD_NOT_ADD_ABAP_DOC for testing raising CX_STATIC_CHECK.

IMO, this rule should not be run in the context of aUnit methods. Maybe it is a case of personal taste 😉

Activity

  1. jmgrassau commented on Sep 7, 2023

    @jmgrassau
    Member

    Hi Suhas,

    just to be sure, the idea would be to add an option suppressing this rule in the context of FOR TESTING methods? (Or even FOR TESTING classes as a whole, so it wouldn't run on helper methods in those classes, either?)

    If this is not specific to test code versus product code, this option would help:

    image

    Kind regards,
    Jörg-Michael

  2. suynwa commented on Sep 8, 2023

    @suynwa
    Author

    Hi Jörg-Michael,

    I would rather skip the rule for aunit methods instead of providing an option. I don't think any one would like to document exceptions for aunit methods.

    methods SHOULD_NOT_ADD_ABAP_DOC for testing raising CX_STATIC_CHECK.

    In case some one wants to document these exceptions, (s)he can use the ADT quickfix (Ctrl+1) "Add missing parameters to documentation".

    KR,
    Suhas

  3. self-assigned this
    on Sep 22, 2023
  4. jmgrassau commented on Sep 22, 2023

    @jmgrassau
    Member

    Hi Suhas,

    alright, this will be changed with the next release, meaning that no ABAP Doc line is added for exceptions of test methods. Nevertheless, if exceptions are already documented,

    • existing ABAP Doc lines are kept if the exceptions are still raised
    • they are removed if the exception was removed
    • their order is aligned.

    image

    Instead of an option, I added some documentation …

    image

    … so if someone comes up with convincing arguments why they need this, we could still add an option for it at a later point in time.

    Kind regards,
    Jörg-Michael

  5. jmgrassau commented on Sep 22, 2023

    @jmgrassau
    Member

    Hi Suhas,

    thanks again for this issue – this is now included in version 1.5.4 which was just released!

    Kind regards,
    Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions