diff --git a/CHANGELOG b/CHANGELOG index b0f55ad..fa87ae3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,17 @@ CHANGELOG ========= +3.1.0 +----- + +* Upgrade checkstyle to 7.8 +* Upgrade sevntu to 1.24.0 +* Add Rule: MoveVariableInsideIf +* Add Rule: ForbidWildcardAsReturnType +* Modify Rule: ExplicitInitialization only applies to objects +* Add Wercker CI +* Add Shippable CI + 3.0.1 ----- diff --git a/README.md b/README.md index ac39463..5e53626 100644 --- a/README.md +++ b/README.md @@ -903,13 +903,15 @@ Checks that when a class overrides the `equals()` method, that it also overrides Limits the number of executable statements in a method to 30. #### [ExplicitInitialization](http://checkstyle.sourceforge.net/config_coding.html#ExplicitInitialization) -Checks that fields are not being explicitly initialised to their already default value. +Checks that object fields are not being explicitly initialised to their already default value. + +Does not check primitive field types. Valid: ```` class Valid { - private int foo; + private int foo = 0; private Object bar; } @@ -919,7 +921,7 @@ Invalid: ```` class Invalid { - private int foo = 0; + private Integer foo = 0; private Object bar = null; } diff --git a/builder/pom.xml b/builder/pom.xml index 73294ba..5e4b51a 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -12,7 +12,7 @@ kemitix-checkstyle-ruleset-builder - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT jar Kemitix Checkstyle Ruleset Builder diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 3b60a5d..ec5e0d0 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -275,6 +275,8 @@ rules: enabled: true source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_coding.html#ExplicitInitialization + properties: + onlyObjectReferences: true - name: FallThrough parent: TREEWALKER diff --git a/builder/src/main/resources/rules/ExplicitInitialization.md b/builder/src/main/resources/rules/ExplicitInitialization.md index 62b851c..507d64b 100644 --- a/builder/src/main/resources/rules/ExplicitInitialization.md +++ b/builder/src/main/resources/rules/ExplicitInitialization.md @@ -1,11 +1,13 @@ -Checks that fields are not being explicitly initialised to their already default value. +Checks that object fields are not being explicitly initialised to their already default value. + +Does not check primitive field types. Valid: ```` class Valid { - private int foo; + private int foo = 0; private Object bar; } @@ -15,7 +17,7 @@ Invalid: ```` class Invalid { - private int foo = 0; + private Integer foo = 0; private Object bar = null; } diff --git a/plugin-sample/pom.xml b/plugin-sample/pom.xml index 2c7d70d..eee3810 100644 --- a/plugin-sample/pom.xml +++ b/plugin-sample/pom.xml @@ -10,12 +10,12 @@ net.kemitix kemitix-checkstyle-ruleset-sample-parent - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../sample-parent kemitix-checkstyle-ruleset-plugin-sample - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT Kemitix Checkstyle Ruleset Plugin Sample Sample usage of the Kemitix Checkstyle Ruleset Plugin diff --git a/plugin/pom.xml b/plugin/pom.xml index db90e76..830dd43 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -7,7 +7,7 @@ net.kemitix kemitix-checkstyle-ruleset-parent - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT kemitix-checkstyle-ruleset-maven-plugin diff --git a/pom.xml b/pom.xml index 5c317d7..836de62 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.kemitix kemitix-checkstyle-ruleset-parent - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT pom Kemitix Checkstyle Ruleset (Parent) diff --git a/regressions/pom.xml b/regressions/pom.xml index 9fa775d..77f8904 100644 --- a/regressions/pom.xml +++ b/regressions/pom.xml @@ -5,7 +5,7 @@ kemitix-checkstyle-ruleset-sample-parent net.kemitix - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../sample-parent 4.0.0 diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java index 322b589..d2987c1 100644 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java +++ b/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java @@ -29,16 +29,8 @@ package net.kemitix.checkstyle.regressions; @SuppressWarnings("hideutilityclassconstructor") class ExplicitInitialization { - /** - * This will become valid in next release. - */ - @SuppressWarnings("explicitinitialization") private boolean validBoolean = false; - /** - * This will become valid in next release. - */ - @SuppressWarnings("explicitinitialization") private int validInt = 0; private String validString = ""; diff --git a/ruleset/pom.xml b/ruleset/pom.xml index 1daa208..0aa98b4 100644 --- a/ruleset/pom.xml +++ b/ruleset/pom.xml @@ -7,11 +7,11 @@ net.kemitix kemitix-checkstyle-ruleset-parent - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT kemitix-checkstyle-ruleset - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT jar Kemitix Checkstyle Ruleset 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 4a5e460..08ac646 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml @@ -50,7 +50,9 @@ - + + + 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 7181911..95ead8f 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml @@ -69,7 +69,9 @@ - + + + diff --git a/sample-parent/pom.xml b/sample-parent/pom.xml index f59ce12..c91556d 100644 --- a/sample-parent/pom.xml +++ b/sample-parent/pom.xml @@ -8,7 +8,7 @@ kemitix-checkstyle-ruleset-sample-parent pom - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT Kemitix Checkstyle Ruleset Sample Parent Sample parent for modules that use kemitix-checkstyle-ruleset-maven-plugin diff --git a/travis-ci/travis-deploy.sh b/travis-ci/travis-deploy.sh index 6ff7008..5e59a85 100755 --- a/travis-ci/travis-deploy.sh +++ b/travis-ci/travis-deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then +if [ "$TRAVIS_BRANCH" = 'master' ]; then echo "Preparing to deploy to nexus..." openssl aes-256-cbc -K $encrypted_efec3258f55d_key -iv $encrypted_efec3258f55d_iv \ -in travis-ci/codesigning.asc.enc -out travis-ci/codesigning.asc -d