Issue with Triggering Branch Coverage for Specific Indentation Cases. #16906
-
|
Hi, To address this issue, I initially reduced the branch and line coverage, but the maintainers do not allow this approach. As an alternative solution, I generated the JaCoCo report using ArrayInitHandler https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ArrayInitHandler.javaAll the possible test cases are already included in:
https://github.com/checkstyle/checkstyle/blob/master/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/indentation/InputIndentationInvalidArrayInitIndent.java After debugging the methods
If we omit the indentation comment, it triggers the branches mentioned above—but Checkstyle expects the indentation comment to be present. same explanation for this class also AnnotationArrayInitHandler@romani can you help me with this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is good enough reason to have exception from rule to allow test inputs without comments. Please make test without trailing comments and above test please put comments with link to this discussion to explain reason of not following rules. |
Beta Was this translation helpful? Give feedback.
-
Sorry, my previous statement wasn't accurate. |
Beta Was this translation helpful? Give feedback.


This is good enough reason to have exception from rule to allow test inputs without comments.
Please make test without trailing comments and above test please put comments with link to this discussion to explain reason of not following rules.