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