checkstyle
checkstyle copied to clipboard
Issue #12036: Kill surviving mutation in AnnotationUseStyleCheck related to trailingArrayComma
#12036
Link to check documentation: https://checkstyle.sourceforge.io/config_annotation.html#AnnotationUseStyle
Regression Reports:
- DefaultConfig: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/b9302d2_2022111833/reports/diff/index.html
- trailingArrayCommaAlways: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/6c1c4ca_2022160315/reports/diff/index.html
Rationale:
The default value TrailingArrayCommaOption.NEVER was never used in the comparison, moreover the order of if statements guaranteed that the default value when replaced with null does not affect the logic.
The logic was modified a bit to use TrailingArrayCommaOption.NEVER.
The value of trailingArrayCommaOption inside logCommaViolation(..) won't be TrailingArrayCommaOption.IGNORE, following code guarantees it: https://github.com/checkstyle/checkstyle/blob/696cd880e83b6c0af3171bf003ebb142eb4c0d35/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java#L532-L534
Generating reports:
Diff Regression config: https://gist.githubusercontent.com/Vyom-Yadav/98dceb63a79f4833e85fff9b2e1464a6/raw/852929bac9a634a1e3b0db40bf6b65b8dc74e2d0/my_checks.xml Report label: trailingArrayCommaAlways
Github, generate report
Github, generate report
DefaultConfig: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/b9302d2_2022111833/reports/diff/index.html
Github, generate report
trailingArrayCommaAlways: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/6c1c4ca_2022160315/reports/diff/index.html
@nick-mancuso ping
looks good. @Vyom-Yadav , please rebase on master
Done.