builder: stub application

This commit is contained in:
Paul Campbell 2017-01-03 19:57:43 +00:00
parent 187b4ba3c2
commit 500d90a6c8
7 changed files with 176 additions and 0 deletions

View file

@ -0,0 +1,22 @@
package net.kemitix.checkstyle.ruleset.builder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* Creates the checkstyle ruleset files.
*
* <p>This application is intended to only to be used by the developer to create the actual checkstyle xml files that
* this module provides.</p>
*
* @author Paul Campbell (pcampbell@kemitix.net)
*/
@Slf4j
@SpringBootApplication
public class CheckstyleRulesetBuilderApplication {
public static void main(final String[] args) {
SpringApplication.run(CheckstyleRulesetBuilderApplication.class, args);
}
}

View file

@ -0,0 +1,52 @@
package net.kemitix.checkstyle.ruleset.builder;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.io.File;
/**
* Properties defining the output files.
*
* @author Paul Campbell (pcampbell@kemitix.net)
*/
@Slf4j
@Setter
@Getter
@Configuration
@ConfigurationProperties(prefix = "output")
class OutputProperties {
/**
* The directory to create the output files in.
*/
private File directory;
/**
* The name of the level 1 ruleset file.
*/
private String level1;
/**
* The name of the level 2 ruleset file.
*/
private String level2;
/**
* The name of the level 3 ruleset file.
*/
private String level3;
/**
* The name of the level 4 ruleset file.
*/
private String level4;
/**
* The name of the level 5 ruleset file.
*/
private String level5;
}

View file

@ -0,0 +1,38 @@
package net.kemitix.checkstyle.ruleset.builder;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* .
*
* @author Paul Campbell (paul.campbell@hubio.com)
*/
@ToString
@Setter
@Getter
class Rule {
private String name;
private RuleParent parent;
private RuleLevel level;
private boolean enabled;
private RuleSource source;
private URI uri;
private Map<String, String> properties = new HashMap<>();
private List<String> body = new ArrayList<>();
}

View file

@ -0,0 +1,15 @@
package net.kemitix.checkstyle.ruleset.builder;
/**
* .
*
* @author Paul Campbell (paul.campbell@hubio.com)
*/
public enum RuleLevel {
LAYOUT,
NAMING,
JAVADOC,
TWEAKS,
COMPLEXITY;
}

View file

@ -0,0 +1,12 @@
package net.kemitix.checkstyle.ruleset.builder;
/**
* .
*
* @author Paul Campbell (paul.campbell@hubio.com)
*/
public enum RuleParent {
CHECKER,
TREEWALKER;
}

View file

@ -0,0 +1,12 @@
package net.kemitix.checkstyle.ruleset.builder;
/**
* .
*
* @author Paul Campbell (paul.campbell@hubio.com)
*/
public enum RuleSource {
CHECKSTYLE,
SEVNTU;
}

View file

@ -0,0 +1,25 @@
package net.kemitix.checkstyle.ruleset.builder;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.HashSet;
import java.util.Set;
/**
* Properties defining the enabled rules for each level.
*
* @author Paul Campbell (pcampbell@kemitix.net)
*/
@Slf4j
@Setter
@Getter
@Configuration
@ConfigurationProperties(prefix = "rules")
class RulesProperties {
public Set<Rule> rules = new HashSet<>();
}