From e2069b8d0d3571576693278144e65b3e9c3956ca Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 6 Jan 2017 16:24:22 +0000 Subject: [PATCH] builder: meet level 4 tweaks * Add missing Rule SuppressWarningsFilter * Suppress HideUtilityClassConstructor on main class --- README.md | 5 +++++ builder/pom.xml | 2 +- .../builder/CheckstyleRulesetBuilderApplication.java | 1 + builder/src/main/resources/application.yml | 7 +++++++ builder/src/main/resources/rules/SuppressWarningsFilter.md | 2 ++ .../src/main/resources/net/kemitix/checkstyle-2-naming.xml | 1 + .../main/resources/net/kemitix/checkstyle-3-javadoc.xml | 1 + .../src/main/resources/net/kemitix/checkstyle-4-tweaks.xml | 1 + .../main/resources/net/kemitix/checkstyle-5-complexity.xml | 1 + 9 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 builder/src/main/resources/rules/SuppressWarningsFilter.md diff --git a/README.md b/README.md index 81f8483..2c032e1 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,7 @@ Rule|Level|Source|Enabled|Suppressable [SuperClone](#superclone)|tweaks|checkstyle|| [SuperFinalize](#superfinalize)|tweaks|checkstyle|| [SuppressWarnings](#suppresswarnings)|naming|checkstyle|Yes| +[SuppressWarningsFilter](#suppresswarningsfilter)|naming|checkstyle|Yes| [SuppressWarningsHolder](#suppresswarningsholder)|naming|checkstyle|Yes| [TernaryPerExpressionCount](#ternaryperexpressioncount)|tweaks|sevntu|Yes| [ThrowsCount](#throwscount)|complexity|checkstyle|Yes| @@ -2071,6 +2072,10 @@ Prevents the use of `@SuppressWarnings` for the following checks: Used by Checkstyle to hold the checks to be suppressed from `@SuppressWarnings(...)` annotations. +#### [SuppressWarningsFilter](http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsFilter) + +Allows the use of the `@SuppressWarnings` annotation. + #### [ThrowsCount](http://checkstyle.sourceforge.net/config_design.html#ThrowsCount) Restricts non-private methods to only `throws` 4 distinct Exception types. Exceptions should be hierarchical to allow catching suitable root Exceptions. diff --git a/builder/pom.xml b/builder/pom.xml index fa18654..7fde516 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -25,7 +25,7 @@ 7.3 1.22.0 2.0.0-SNAPSHOT - 3-javadoc + 4-tweaks diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java index 4d04c83..e095897 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java @@ -38,6 +38,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties */ @EnableConfigurationProperties({RulesProperties.class, OutputProperties.class}) @SpringBootApplication +@SuppressWarnings("hideutilityclassconstructor") public class CheckstyleRulesetBuilderApplication { /** diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 891ab36..674e39a 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -854,6 +854,13 @@ rules: enabled: true source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder + - + name: SuppressWarningsFilter + parent: CHECKER + level: NAMING + enabled: true + source: CHECKSTYLE + uri: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsFilter - name: ThrowsCount parent: TREEWALKER diff --git a/builder/src/main/resources/rules/SuppressWarningsFilter.md b/builder/src/main/resources/rules/SuppressWarningsFilter.md new file mode 100644 index 0000000..3bc1f3e --- /dev/null +++ b/builder/src/main/resources/rules/SuppressWarningsFilter.md @@ -0,0 +1,2 @@ + +Allows the use of the `@SuppressWarnings` annotation. diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml index 8c93a6b..d27be47 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml @@ -12,6 +12,7 @@ + diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml index 50bda7e..1fe56af 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml @@ -13,6 +13,7 @@ + diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml index efa1674..cf4ce72 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml @@ -13,6 +13,7 @@ + diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml index 66acfe0..44de9aa 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml @@ -14,6 +14,7 @@ +