Add level 0 Disabled

This commit is contained in:
Paul Campbell 2017-05-31 12:10:06 +01:00
parent 253526ee97
commit 2b8533273f
6 changed files with 23 additions and 3 deletions

View file

@ -27,6 +27,7 @@ The `maven-checkstyle-plugin` will be included automatically.
The following levels implement increasingly strict rulesets: The following levels implement increasingly strict rulesets:
* 0-disabled
* 1-layout * 1-layout
* 2-naming * 2-naming
* 3-javadoc * 3-javadoc

View file

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

View file

@ -27,6 +27,7 @@ The `maven-checkstyle-plugin` will be included automatically.
The following levels implement increasingly strict rulesets: The following levels implement increasingly strict rulesets:
* 0-disabled
* 1-layout * 1-layout
* 2-naming * 2-naming
* 3-javadoc * 3-javadoc

View file

@ -1,6 +1,7 @@
output: output:
directory: ruleset/src/main/resources/net/kemitix directory: ruleset/src/main/resources/net/kemitix
ruleset-files: ruleset-files:
DISABLED: checkstyle-0-disabled.xml
LAYOUT: checkstyle-1-layout.xml LAYOUT: checkstyle-1-layout.xml
NAMING: checkstyle-2-naming.xml NAMING: checkstyle-2-naming.xml
JAVADOC: checkstyle-3-javadoc.xml JAVADOC: checkstyle-3-javadoc.xml

View file

@ -67,7 +67,8 @@ public class CheckstyleWriterTest {
ruleName = "RegexpOnFilename"; ruleName = "RegexpOnFilename";
ruleClassname = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck"; ruleClassname = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck";
outputProperties = new OutputProperties(); 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.NAMING))
.put(getOutputFile(RuleLevel.JAVADOC)) .put(getOutputFile(RuleLevel.JAVADOC))
.put(getOutputFile(RuleLevel.TWEAKS)) .put(getOutputFile(RuleLevel.TWEAKS))
@ -221,8 +222,8 @@ public class CheckstyleWriterTest {
final ThrowableAssert.ThrowingCallable action = () -> checkstyleWriter.run(); final ThrowableAssert.ThrowingCallable action = () -> checkstyleWriter.run();
//then //then
assertThatThrownBy(action).isInstanceOf(CheckstyleWriterException.class) assertThatThrownBy(action).isInstanceOf(CheckstyleWriterException.class)
.hasMessage( .hasMessageStartingWith(
String.format("java.nio.file.NoSuchFileException: %scheckstyle-LAYOUT.xml", String.format("java.nio.file.NoSuchFileException: %scheckstyle-",
imaginary + FILE_SEPARATOR 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 -->