From 2b8533273f2e469dfb62c9e62b70ee8124322e05 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 31 May 2017 12:10:06 +0100 Subject: [PATCH 1/2] Add level 0 Disabled --- README.md | 1 + .../checkstyle/ruleset/builder/RuleLevel.java | 1 + builder/src/main/resources/README-template.md | 1 + builder/src/main/resources/application.yml | 1 + .../ruleset/builder/CheckstyleWriterTest.java | 7 ++++--- .../net/kemitix/checkstyle-0-disabled.xml | 15 +++++++++++++++ 6 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 ruleset/src/main/resources/net/kemitix/checkstyle-0-disabled.xml diff --git a/README.md b/README.md index 5e53626..a58651e 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ The `maven-checkstyle-plugin` will be included automatically. The following levels implement increasingly strict rulesets: +* 0-disabled * 1-layout * 2-naming * 3-javadoc diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLevel.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLevel.java index 53cad91..cece07a 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLevel.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLevel.java @@ -28,6 +28,7 @@ package net.kemitix.checkstyle.ruleset.builder; */ public enum RuleLevel { + DISABLED, LAYOUT, NAMING, JAVADOC, diff --git a/builder/src/main/resources/README-template.md b/builder/src/main/resources/README-template.md index a6f9614..efd53b7 100644 --- a/builder/src/main/resources/README-template.md +++ b/builder/src/main/resources/README-template.md @@ -27,6 +27,7 @@ The `maven-checkstyle-plugin` will be included automatically. The following levels implement increasingly strict rulesets: +* 0-disabled * 1-layout * 2-naming * 3-javadoc diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index ec5e0d0..e3ef8a4 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -1,6 +1,7 @@ output: directory: ruleset/src/main/resources/net/kemitix ruleset-files: + DISABLED: checkstyle-0-disabled.xml LAYOUT: checkstyle-1-layout.xml NAMING: checkstyle-2-naming.xml JAVADOC: checkstyle-3-javadoc.xml diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java index 1ad7836..5cd29f1 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java @@ -67,7 +67,8 @@ public class CheckstyleWriterTest { ruleName = "RegexpOnFilename"; ruleClassname = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck"; outputProperties = new OutputProperties(); - outputFiles = new MapBuilder().put(getOutputFile(RuleLevel.LAYOUT)) + outputFiles = new MapBuilder().put(getOutputFile(RuleLevel.DISABLED)) + .put(getOutputFile(RuleLevel.LAYOUT)) .put(getOutputFile(RuleLevel.NAMING)) .put(getOutputFile(RuleLevel.JAVADOC)) .put(getOutputFile(RuleLevel.TWEAKS)) @@ -221,8 +222,8 @@ public class CheckstyleWriterTest { final ThrowableAssert.ThrowingCallable action = () -> checkstyleWriter.run(); //then assertThatThrownBy(action).isInstanceOf(CheckstyleWriterException.class) - .hasMessage( - String.format("java.nio.file.NoSuchFileException: %scheckstyle-LAYOUT.xml", + .hasMessageStartingWith( + String.format("java.nio.file.NoSuchFileException: %scheckstyle-", imaginary + FILE_SEPARATOR )); } diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-0-disabled.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-0-disabled.xml new file mode 100644 index 0000000..2471726 --- /dev/null +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-0-disabled.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + From 55abc1959f586bb8f475e992af0ecf5cf0f16bb3 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 31 May 2017 18:17:59 +0100 Subject: [PATCH 2/2] travis-ci: publish code coverate to codecov --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 528aa2d..d43d3d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ install: true script: "./mvnw clean install" after_success: - "./travis-ci/travis-coveralls-report.sh" +- bash <(curl -s https://codecov.io/bash) - "./travis-ci/travis-deploy.sh" env: global: