Checkstyle validates that all configurable properties of checks are demonstrated in the XDocs examples. However, some properties are currently missing from the examples and are temporarily suppressed in the test XdocsExampleFileTest.java.
This issue aims to allow new contributors to improve test coverage by adding valid entries to the appropriate Xdocs example files (found under src/xdocs-examples/resources-noncompilable/... or src/xdocs-examples/resources/...) and removing the corresponding entry from the suppression list once the example is added.
- Add valid Xdoc example usages (i.e., in /*xml blocks) for the listed properties.
- Ensure that the test
XdocsExampleFileTest passes without relying on suppression for the properties once they are added.
- Clean up the suppression list by removing each property from the
SUPPRESSED_PROPERTIES_BY_CHECK map when it’s properly covered.
Preferable if single Pull Request covers whole Check.
most accurate list of suppressions to fix is at
|
// Until: https://github.com/checkstyle/checkstyle/issues/17449 |
|
private static final Map<String, Set<String>> SUPPRESSED_PROPERTIES_BY_CHECK = Map.ofEntries( |
|
Map.entry("SuppressWarningsHolder", Set.of("aliasList")), |
|
Map.entry("IndentationCheck", Set.of( |
|
"basicOffset", |
|
"lineWrappingIndentation", |
|
"throwsIndent", |
|
"arrayInitIndent", |
|
"braceAdjustment" |
|
)) |
|
); |
Example of expected update: #17844
ATTENTION: please keep all examples same by java code and different only by trailing comment among all example , see all details and images at #13345
Checkstyle validates that all configurable properties of checks are demonstrated in the XDocs examples. However, some properties are currently missing from the examples and are temporarily suppressed in the test
XdocsExampleFileTest.java.This issue aims to allow new contributors to improve test coverage by adding valid entries to the appropriate Xdocs example files (found under
src/xdocs-examples/resources-noncompilable/... or src/xdocs-examples/resources/...) and removing the corresponding entry from the suppression list once the example is added.XdocsExampleFileTestpasses without relying on suppression for the properties once they are added.SUPPRESSED_PROPERTIES_BY_CHECKmap when it’s properly covered.Preferable if single Pull Request covers whole Check.
most accurate list of suppressions to fix is at
checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsExampleFileTest.java
Lines 59 to 69 in b58ea1e
Example of expected update: #17844
ATTENTION: please keep all examples same by java code and different only by trailing comment among all example , see all details and images at #13345