Merge pull request #51 from kemitix/add-level-0-disabled

Add level 0 Disabled
This commit is contained in:
Paul Campbell 2017-05-31 18:37:32 +01:00 committed by GitHub
commit 25e2e47e3c
7 changed files with 24 additions and 3 deletions

View file

@ -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:

View file

@ -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

View file

@ -28,6 +28,7 @@ package net.kemitix.checkstyle.ruleset.builder;
*/
public enum RuleLevel {
DISABLED,
LAYOUT,
NAMING,
JAVADOC,

View file

@ -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

View file

@ -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

View file

@ -67,7 +67,8 @@ public class CheckstyleWriterTest {
ruleName = "RegexpOnFilename";
ruleClassname = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck";
outputProperties = new OutputProperties();
outputFiles = new MapBuilder<RuleLevel, String>().put(getOutputFile(RuleLevel.LAYOUT))
outputFiles = new MapBuilder<RuleLevel, String>().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
));
}

View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
</module><!-- /TreeWalker -->
</module><!-- /Checker -->