-  
-   Notifications  You must be signed in to change notification settings 
- Fork 3.9k
Description
This Issue deals with enabling Example Checks.
 If you plan to help us to fix issue, thanks a lot first of all, and secondly please make a comment "I am on xxxCheck" to let others know that you are working on it to avoid conflicts.
Some examples from the website are uncompilable and untested ..... conversion of .txt to .java and removal of @Disabled annotatioon in Test class will make them active.
Examples of ideal updates :
These commits implement your idea of example same by java code and different by violation comments .
Please create 1 PR for each Check , please look at referenced PR commits as example of update.
RULES :
- The java code/structure is same for all examples ( meaning they should follow one template and look the same )
- Only comments are changing in content from Example1 to Example2 and so on....
- If code line is present in one Example on Line X, it should be located on same line in all other Examples.
- Lines raising violations should be commented using " // violation"
- If line contains only violation comment but violation is not raised, it should be empty line or " // ok, because ...."
Visual sample of how examples should be same by java structure/statements but different by comments
 (taken from PR):
 
 one more example(html, pull request):
 
 one more example (java code reuse same line numbers and only comments are changing by content):
 
List of remaining checks' tests:
- SuppressWithNearbyTextFilterExamplesTest.java
- SuppressWarningsFilterExamplesTest.java
- SuppressionSingleFilterExamplesTest.java
- SuppressionXpathSingleFilterExamplesTest.java
- SuppressWithNearbyCommentFilterExamplesTest.java
- SuppressWithPlainTextCommentFilterExamplesTest.java
- SuppressionCommentFilterExamplesTest.java
- RegexpSinglelineCheckExamplesTest.java
- RegexpSinglelineJavaCheckExamplesTest.java
- RegexpCheckExamplesTest.java
- RegexpOnFilenameCheckExamplesTest.java
- RegexpMultilineCheckExamplesTest.java
- PackageNameCheckExamplesTest.java
- ClassFanOutComplexityCheckExamplesTest.java
- CyclomaticComplexityCheckExamplesTest.java
- JavaNCSSCheckExamplesTest.java
- NPathComplexityCheckExamplesTest.java
- AnonInnerLengthCheckExamplesTest.java
- LineLengthCheckExamplesTest.java
- ExecutableStatementCountCheckExamplesTest.java
- InterfaceMemberImpliedModifierCheckExamplesTest.java
- TranslationCheckExamplesTest.java
- IndentationCheckExamplesTest.java
- CommentsIndentationCheckExamplesTest.java
- OrderedPropertiesCheckExamplesTest.java
- DescendantTokenCheckExamplesTest.java
- PackageDeclarationCheckExamplesTest.java
- MissingSwitchDefaultCheckExamplesTest.java
- NestedTryDepthCheckExamplesTest.java
- MagicNumberCheckExamplesTest.java
- HeaderCheckExamplesTest.java
- RegexpHeaderCheckExamplesTest.java
- UniquePropertiesCheckExamplesTest.java
- ImportOrderCheckExamplesTest.java
- IllegalImportCheckExamplesTest.java
- CustomImportOrderCheckExamplesTest.java
- JavadocMethodCheckExamplesTest.java
- SummaryJavadocCheckExamplesTest.java
- JavadocTypeCheckExamplesTest.java
- WriteTagCheckExamplesTest.java
- JavadocStyleCheckExamplesTest.java
- MissingJavadocMethodCheckExamplesTest.java
- JavadocPackageCheckExamplesTest.java
- MissingJavadocTypeCheckExamplesTest.java
- JavadocTagContinuationIndentationCheckExamplesTest.java
- MissingJavadocPackageCheckExamplesTest.java
- NonEmptyAtclauseDescriptionCheckExamplesTest.java
- BeforeExecutionExclusionFileFilterExamplesTest.java
Generate list of tests by:
DISABLED_EXAMPLE_TESTS=$(ag -Ql '@Disabled("until https://github.com/checkstyle/checkstyle/issues/13345")') echo "$DISABLED_EXAMPLE_TESTS" | while read -r line; do b=$(basename "$line") && echo " - [ ] $b"; done