diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c50d110..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule ".travis-support"] - path = .travis-support - url = https://github.com/kemitix/kemitix-travis-support.git diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 56bb016..b573bb5 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1 @@ -distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip \ No newline at end of file +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip diff --git a/.travis-support b/.travis-support deleted file mode 160000 index b97def2..0000000 --- a/.travis-support +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b97def251b784ecc8de6d3cc30d2793ac0bd375e diff --git a/.travis.yml b/.travis.yml index 0d1d54a..108fbc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,4 @@ cache: directories: - "$HOME/.m2" install: true -script: "./mvnw clean install" -after_success: -- sh .travis-support/coveralls.sh -- bash <(curl -s https://codecov.io/bash) -deploy: - provider: script - script: sh .travis-support/deploy.sh - on: - branch: master -env: - global: +script: "./mvnw --batch-mode --errors --update-snapshots clean install" diff --git a/CHANGELOG b/CHANGELOG index 4a2e86b..b91076c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,16 @@ CHANGELOG ========= +4.1.0 +----- + +* EmptyLineSeparator: disabled +* Upgrade `tiles-maven-plugin` to 2.11 +* Upgrade `checkstyle` to 8.10 +* Upgrade `sevntu-checkstyle` to 1.29.0 +* Upgrade `secntu-checkstyle` to 1.27.0 +* Upgrade `checkstyle` to 8.7 (properly now that it is supported by sevntu) + 4.0.1 ----- diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy new file mode 100644 index 0000000..9c3189e --- /dev/null +++ b/Jenkinsfile.groovy @@ -0,0 +1,86 @@ +final String mvn = "mvn --batch-mode --update-snapshots --errors" +final dependenciesSupportJDK=9 + +pipeline { + agent any + stages { + stage('master != SNAPSHOT') { + // checks that the pom version is not a snapshot when the current or target branch is master + when { + expression { + (env.GIT_BRANCH == 'master' || env.CHANGE_TARGET == 'master') && + (readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") + } + } + steps { + error("Build failed because SNAPSHOT version") + } + } + stage('Build & Test') { + steps { + withMaven(maven: 'maven', jdk: 'JDK LTS') { + sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test" + //junit '**/target/surefire-reports/*.xml' + sh "${mvn} -pl builder jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " + + "-DcoverageReportFile=target/site/jacoco/jacoco.xml " + + "-DprojectToken=`$JENKINS_HOME/codacy/token` " + + "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " + + "-Dcommit=`git rev-parse HEAD`" + jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' + pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' + step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher', + pattern: '**/target/checkstyle-result.xml', + healthy:'20', + unHealthy:'100']) + } + } + } + stage('Verify & Install') { + steps { + withMaven(maven: 'maven', jdk: 'JDK LTS') { + sh "${mvn} -DskipTests install" + } + } + } + stage('SonarQube (github only)') { + when { expression { env.GIT_URL.startsWith('https://github.com') } } + steps { + withSonarQubeEnv('sonarqube') { + withMaven(maven: 'maven', jdk: 'JDK LTS') { + sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" + } + } + } + } + stage('Archiving') { + when { expression { findFiles(glob: '**/target/*.jar').length > 0 } } + steps { + archiveArtifacts '**/target/*.jar' + } + } + stage('Deploy (master on github)') { + when { expression { (env.GIT_BRANCH == 'master' && env.GIT_URL.startsWith('https://github.com')) } } + steps { + withMaven(maven: 'maven', jdk: 'JDK LTS') { + sh "${mvn} deploy --activate-profiles release -DskipTests=true" + } + } + } + stage('Build Java 9') { + when { expression { dependenciesSupportJDK >= 9 } } + steps { + withMaven(maven: 'maven', jdk: 'JDK 9') { + sh "${mvn} clean verify -Djava.version=9" + } + } + } + stage('Build Java 10') { + when { expression { dependenciesSupportJDK >= 10 } } + steps { + withMaven(maven: 'maven', jdk: 'JDK 10') { + sh "${mvn} clean verify -Djava.version=10" + } + } + } + } +} diff --git a/README.md b/README.md index 99c48f1..ce8abaf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The simplest way to use the ruleset is with the maven-tile: ```xml - 2.10 + 2.11 @@ -101,7 +101,7 @@ Rule|Level|Source|Enabled|Suppressible [EmptyCatchBlock](#emptycatchblock)|tweaks|checkstyle|Yes| [EmptyForInitializerPad](#emptyforinitializerpad)|layout|checkstyle|Yes| [EmptyForIteratorPad](#emptyforiteratorpad)|layout|checkstyle|Yes| -[EmptyLineSeparator](#emptylineseparator)|layout|checkstyle|Yes| +[EmptyLineSeparator](#emptylineseparator)|layout|checkstyle|| [EmptyPublicCtorInClass](#emptypublicctorinclass)|tweaks|sevntu|Yes| [EmptyStatement](#emptystatement)|layout|checkstyle|Yes| [EnumValueName](#enumvaluename)|naming|sevntu|Yes| @@ -768,59 +768,6 @@ Invalid: ```` for (Iterator i = list.getIterator(); i.hasNext() ; ) {} ```` -#### [EmptyLineSeparator](http://checkstyle.sourceforge.net/config_whitespace.html#EmptyLineSeparator) - -Checks that there are blank lines between header, package, import blocks, field, constructors, methods, nested classes, static initialisers and instance initialisers. - -Valid: -```` -/** - * Licence header. - */ - -package net.kemitix.foo; - -import ...; -import ...; - -class Foo { - - private int a; - - private int b; - - Foo() {} - - Foo(int a, int b) {} - - int getA() {} - - int getB() {} - - class Bar { - } -} -```` - -Invalid: -```` -/** - * Licence header. - */ -package net.kemitix.foo; -import ...; -import ...; -class Foo { - private int a; - private int b; - Foo() {} - Foo(int a, int b) {} - int getA() {} - int getB() {} - class Bar { - } -} -```` #### [EmptyStatement](http://checkstyle.sourceforge.net/config_coding.html#EmptyStatement) Checks for empty statements. An empty statement is a standalone semicolon (;). @@ -2385,8 +2332,6 @@ if (condition) { } return ""; ```` - -Example: [MoveVariableInsideIf.java](https://github.com/kemitix/kemitix-checkstyle-ruleset/blob/master/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java) #### [NameConventionForJunit4TestClasses](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/NameConventionForJunit4TestClassesCheck.html) Checks the names of JUnit test classes. Classes checked are those that have at least one method annotated with `Test` or `org.junit.Test`. @@ -2643,6 +2588,9 @@ Ref: Clean Code, Robert C. Martin, J1: Avoid Long Import Lists by Using Wildcard Ref: Clean Code, Robert C. Martin, J2: Don't Inherit Constants Recommends using a static import to access constants from another class over inheriting them. +#### [EmptyLineSeparator](http://checkstyle.sourceforge.net/config_whitespace.html#EmptyLineSeparator) + + #### [FinalLocalVariable](http://checkstyle.sourceforge.net/config_coding.html#FinalLocalVariable) Doesn't recognise Lombok's `val` as being `final`. diff --git a/builder/pom.xml b/builder/pom.xml index 3015348..671e2cf 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -7,23 +7,23 @@ net.kemitix kemitix-parent - 5.0.3 + 5.1.0 net.kemitix.checkstyle builder jar - 4.0.1 + 4.1.0 true 1.8 - 2.10 - 0.3.0 + 2.11 + 0.8.1 - 8.6 - 1.26.0 + 8.10 + 1.29.0 1.16.20 Brussels-SR6 1.5.9.RELEASE @@ -31,6 +31,8 @@ 1.0.0 2.13.0 3.9.0 + 0.3.0 + 2.18.1 3.0.0 ${project.version} @@ -58,6 +60,16 @@ ${lombok.version} provided + + net.kemitix + conditional + ${conditional.version} + + + io.github.lukehutch + fast-classpath-scanner + ${fast-classpath-scanner.version} + org.mockito mockito-core @@ -130,14 +142,14 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:enforcer-tile:${kemitix-tiles.version} - net.kemitix.tiles:compiler-tile:${kemitix-tiles.version} - net.kemitix.tiles:huntbugs-tile:${kemitix-tiles.version} - net.kemitix.tiles:pmd-tile:${kemitix-tiles.version} - net.kemitix.tiles:testing-tile:${kemitix-tiles.version} - net.kemitix.tiles:coverage-tile:${kemitix-tiles.version} - net.kemitix.tiles:pitest-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} + net.kemitix.tiles:enforcer:${kemitix-tiles.version} + net.kemitix.tiles:compiler:${kemitix-tiles.version} + net.kemitix.tiles:huntbugs:${kemitix-tiles.version} + net.kemitix.tiles:pmd:${kemitix-tiles.version} + net.kemitix.tiles:testing:${kemitix-tiles.version} + net.kemitix.tiles:coverage:${kemitix-tiles.version} + net.kemitix.tiles:pitest:${kemitix-tiles.version} diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfiguration.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfiguration.java index 626c729..d5c7a95 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfiguration.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfiguration.java @@ -21,15 +21,12 @@ package net.kemitix.checkstyle.ruleset.builder; -import com.google.common.reflect.ClassPath; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.io.IOException; import java.util.AbstractMap; import java.util.List; import java.util.Map; -import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -41,18 +38,6 @@ import java.util.stream.Stream; @Configuration public class BuilderConfiguration { - /** - * Create the ClassPath used to scan packages. - * - * @return the ClassPath - * - * @throws IOException if there is an error - */ - @Bean - public ClassPath classPath() throws IOException { - return ClassPath.from(getClass().getClassLoader()); - } - /** * A Map of rules for each RuleSource. * @@ -63,24 +48,11 @@ public class BuilderConfiguration { @Bean public Map> checkClasses(final PackageScanner packageScanner) { return Stream.of(RuleSource.values()) - .map(toRuleSourceEntry(packageScanner)) + .map(source -> entry(source, packageScanner.apply(source))) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } - private static Function>> toRuleSourceEntry( - final PackageScanner packageScanner - ) { - return source -> new AbstractMap.SimpleEntry<>( - source, - classesInSource(source, packageScanner) - ); - } - - private static List classesInSource( - final RuleSource source, - final PackageScanner packageScanner - ) { - return packageScanner.apply(source) - .collect(Collectors.toList()); + private static AbstractMap.SimpleEntry entry(final K key, final V value) { + return new AbstractMap.SimpleEntry<>(key, value); } } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriter.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriter.java index 5c9e137..54a55d9 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriter.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriter.java @@ -21,21 +21,22 @@ package net.kemitix.checkstyle.ruleset.builder; -import com.speedment.common.mapstream.MapStream; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import lombok.val; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; +import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.util.Arrays; -import java.util.Map; +import java.nio.file.Path; +import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; +import static java.util.Arrays.asList; + /** * Writes the Checkstyle XML files. * @@ -46,8 +47,6 @@ import java.util.stream.Stream; @RequiredArgsConstructor class CheckstyleWriter implements CommandLineRunner { - private static final String NEWLINE = System.getProperty("line.separator"); - private final OutputProperties outputProperties; private final TemplateProperties templateProperties; @@ -56,62 +55,79 @@ class CheckstyleWriter implements CommandLineRunner { private final RuleClassLocator ruleClassLocator; + private static Predicate excludeUnspecifiedRuleLevel() { + return level -> !level.equals(RuleLevel.UNSPECIFIED); + } + + private static void writeRuleset( + final Path filePath, + final String content + ) throws IOException { + Files.write(filePath, asList(content.split(System.lineSeparator())), StandardCharsets.UTF_8); + } + + private static String ruleset( + final String checkerRules, + final String treeWalkerRules, + final String template + ) { + return String.format(template, checkerRules, treeWalkerRules); + } + + private static boolean fileExists(final File file) { + return file.exists(); + } + + private static void writeCheckstyleFileWithException( + final Path outputPath, + final String checkerRules, + final String treeWalkerRules, + final Path template + ) throws IOException { + if (fileExists(template.toFile())) { + log.info("Writing ruleset: {}", outputPath); + final String xmlTemplate = new String(Files.readAllBytes(template), StandardCharsets.UTF_8); + writeRuleset(outputPath, ruleset(checkerRules, treeWalkerRules, xmlTemplate)); + } else { + throw new TemplateNotFoundException(template); + } + } + @Override public void run(final String... args) { Stream.of(RuleLevel.values()) - .filter(level -> !level.equals(RuleLevel.UNSPECIFIED)) - .forEach(this::writeCheckstyleFile); + .filter(excludeUnspecifiedRuleLevel()) + .forEach(this::writeCheckstyleFile); } private void writeCheckstyleFile(final RuleLevel ruleLevel) { - val xmlFile = outputProperties.getDirectory() - .resolve(outputProperties.getRulesetFiles() - .get(ruleLevel)); - val checkerRules = rulesProperties.getRules() - .stream() - .filter(Rule::isEnabled) - .filter(rule -> RuleParent.CHECKER.equals(rule.getParent())) - .filter(rule -> ruleLevel.compareTo(rule.getLevel()) >= 0) - .map(this::formatRuleAsModule) - .collect(Collectors.joining(NEWLINE)); - val treeWalkerRules = rulesProperties.getRules() - .stream() - .filter(Rule::isEnabled) - .filter(rule -> RuleParent.TREEWALKER.equals(rule.getParent())) - .filter(rule -> ruleLevel.compareTo(rule.getLevel()) >= 0) - .map(this::formatRuleAsModule) - .collect(Collectors.joining(NEWLINE)); + final Path outputPath = outputPath(ruleLevel); + final String checkerRules = enabledRules(ruleLevel, RuleParent.CHECKER); + final String treeWalkerRules = enabledRules(ruleLevel, RuleParent.TREEWALKER); + final Path template = templateProperties.getCheckstyleXml(); try { - val checkstyleXmlTemplate = templateProperties.getCheckstyleXml(); - if (checkstyleXmlTemplate.toFile() - .exists()) { - val bytes = Files.readAllBytes(checkstyleXmlTemplate); - val template = new String(bytes, StandardCharsets.UTF_8); - val output = Arrays.asList(String.format(template, checkerRules, treeWalkerRules) - .split(NEWLINE)); - log.info("Writing xmlFile: {}", xmlFile); - Files.write(xmlFile, output, StandardCharsets.UTF_8); - } else { - throw new TemplateNotFoundException(checkstyleXmlTemplate); - } + writeCheckstyleFileWithException(outputPath, checkerRules, treeWalkerRules, template); } catch (IOException e) { throw new CheckstyleWriterException(e); } } - private String formatRuleAsModule(final Rule rule) { - if (rule.getProperties() - .isEmpty()) { - return String.format("", ruleClassLocator.apply(rule)); - } - return String.format("%n %s%n", ruleClassLocator.apply(rule), - formatProperties(rule.getProperties()) - ); + private Path outputPath(final RuleLevel ruleLevel) { + return outputProperties.getDirectory() + .resolve(outputProperties.getRulesetFiles() + .get(ruleLevel)); } - private String formatProperties(final Map properties) { - return MapStream.of(properties) - .map((k, v) -> String.format("", k, v)) - .collect(Collectors.joining(NEWLINE)); + private String enabledRules( + final RuleLevel ruleLevel, + final RuleParent ruleParent + ) { + return rulesProperties.getRules() + .stream() + .filter(Rule::isEnabled) + .filter(Rule.hasParent(ruleParent)) + .filter(Rule.isIncludedInLevel(ruleLevel)) + .map(rule -> Rule.asModule(ruleClassLocator.apply(rule), rule)) + .collect(Collectors.joining(System.lineSeparator())); } } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java index aea4769..f193f1b 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java @@ -21,11 +21,11 @@ package net.kemitix.checkstyle.ruleset.builder; -import com.google.common.reflect.ClassPath; -import lombok.RequiredArgsConstructor; +import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner; import org.springframework.stereotype.Service; -import java.util.stream.Stream; +import java.util.List; +import java.util.stream.Collectors; /** * Default implementation of {@link PackageScanner}. @@ -33,15 +33,16 @@ import java.util.stream.Stream; * @author Paul Campbell (pcampbell@kemitix.net). */ @Service -@RequiredArgsConstructor public class DefaultPackageScanner implements PackageScanner { - private final ClassPath classPath; - @Override - public final Stream apply(final RuleSource ruleSource) { - return classPath.getTopLevelClassesRecursive(ruleSource.getBasePackage()) - .stream() - .map(ClassPath.ClassInfo::getName); + public final List apply(final RuleSource ruleSource) { + final String basePackage = ruleSource.getBasePackage(); + return new FastClasspathScanner(basePackage) + .scan() + .getNamesOfAllStandardClasses() + .stream() + .filter(packageName -> packageName.startsWith(basePackage)) + .collect(Collectors.toList()); } } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/PackageScanner.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/PackageScanner.java index 7cc8c2b..02a59df 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/PackageScanner.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/PackageScanner.java @@ -21,14 +21,14 @@ package net.kemitix.checkstyle.ruleset.builder; +import java.util.List; import java.util.function.Function; -import java.util.stream.Stream; /** * Scans a package for all classes. * * @author Paul Campbell (pcampbell@kemitix.net). */ -interface PackageScanner extends Function> { +interface PackageScanner extends Function> { } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/Rule.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/Rule.java index 33c5624..30848f7 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/Rule.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/Rule.java @@ -21,13 +21,17 @@ package net.kemitix.checkstyle.ruleset.builder; +import com.speedment.common.mapstream.MapStream; import lombok.Getter; import lombok.Setter; +import net.kemitix.conditional.Value; import java.net.URI; import java.util.HashMap; import java.util.Locale; import java.util.Map; +import java.util.function.Predicate; +import java.util.stream.Collectors; /** * A single Checkstyle Check. @@ -40,6 +44,10 @@ public class Rule { private static final Locale LOCALE = Locale.ENGLISH; + private static final String MODULE_NO_PROPERTIES = ""; + + private static final String MODULE_WITH_PROPERTIES = "%n %s%n"; + /** * Configuration properties. */ @@ -100,6 +108,69 @@ public class Rule { .compareTo(right.getLowerCaseRuleName()); } + /** + * Predicate to check that the Rule has the given RuleParent. + * + * @param ruleParent the RuleParent to match + * + * @return a Predicate to check a Rule + */ + static Predicate hasParent(final RuleParent ruleParent) { + return rule -> ruleParent.equals(rule.getParent()); + } + + + /** + * Predicate to check that the Rule is included in the given RuleLevel. + * + * @param ruleLevel the RuleLevel to match + * + * @return a Predicate to check a Rule + */ + static Predicate isIncludedInLevel(final RuleLevel ruleLevel) { + return rule -> ruleLevel.compareTo(rule.getLevel()) >= 0; + } + + private static String formatProperties(final Map properties) { + return MapStream.of(properties) + .map((k, v) -> String.format("", k, v)) + .collect(Collectors.joining(System.lineSeparator())); + } + + private static boolean hasProperties(final Rule rule) { + return !rule.getProperties().isEmpty(); + } + + /** + * Formats the Rule as an XML module fragment. + * + * @param rule the Rule to format + * @param ruleClassname the classname for the Rule + * + * @return an XML {@code } fragment + */ + static String asModule( + final String ruleClassname, + final Rule rule + ) { + return Value.where(hasProperties(rule)) + .then(() -> moduleWithParameters(rule, ruleClassname)) + .otherwise(() -> moduleNoParameters(ruleClassname)); + } + + private static String moduleNoParameters( + final String ruleClassname + ) { + return String.format(MODULE_NO_PROPERTIES, ruleClassname); + } + + private static String moduleWithParameters( + final Rule rule, + final String ruleClassname + ) { + return String.format(MODULE_WITH_PROPERTIES, ruleClassname, formatProperties(rule.getProperties())); + } + private String getLowerCaseRuleName() { return getName().toLowerCase(LOCALE); } diff --git a/builder/src/main/resources/README-template.md b/builder/src/main/resources/README-template.md index 5aabff6..66ea631 100644 --- a/builder/src/main/resources/README-template.md +++ b/builder/src/main/resources/README-template.md @@ -20,7 +20,7 @@ The simplest way to use the ruleset is with the maven-tile: ```xml - 2.10 + 2.11 diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 7d504a7..b4d99bb 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -241,9 +241,10 @@ rules: name: EmptyLineSeparator parent: TREEWALKER level: LAYOUT - enabled: true + enabled: false source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_whitespace.html#EmptyLineSeparator + reason: - name: EmptyStatement parent: TREEWALKER @@ -296,6 +297,8 @@ rules: enabled: true source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_sizes.html#FileLength + properties: + max: 500 - name: FileTabCharacter parent: CHECKER @@ -463,9 +466,9 @@ rules: source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_metrics.html#JavaNCSS properties: - classMaximum: 1200 - fileMaximum: 1600 - methodMaximum: 40 + classMaximum: 250 + fileMaximum: 250 + methodMaximum: 12 - name: LeftCurly parent: TREEWALKER @@ -518,7 +521,7 @@ rules: source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_sizes.html#MethodCount properties: - maxTotal: 30 + maxTotal: 10 - name: MethodLength parent: TREEWALKER @@ -527,7 +530,7 @@ rules: source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_sizes.html#MethodLength properties: - max: 40 + max: 30 - name: MethodName parent: TREEWALKER diff --git a/builder/src/main/resources/rules/MoveVariableInsideIfCheck.md b/builder/src/main/resources/rules/MoveVariableInsideIfCheck.md index e5304b3..59a16c5 100644 --- a/builder/src/main/resources/rules/MoveVariableInsideIfCheck.md +++ b/builder/src/main/resources/rules/MoveVariableInsideIfCheck.md @@ -18,5 +18,3 @@ if (condition) { } return ""; ```` - -Example: [MoveVariableInsideIf.java](https://github.com/kemitix/kemitix-checkstyle-ruleset/blob/master/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java) diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfigurationTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfigurationTest.java index 9279196..f9afaa8 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfigurationTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfigurationTest.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Stream; +import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; @@ -20,28 +21,20 @@ import static org.mockito.Mockito.mock; */ public class BuilderConfigurationTest { - @Test - public void canGetClassPath() throws IOException { - //when - final ClassPath classPath = new BuilderConfiguration().classPath(); - //then - assertThat(classPath).isNotNull(); - } - @Test public void canGetCheckClasses() { //given final PackageScanner packageScanner = mock(PackageScanner.class); final String checkstyleClass = "checkstyle class"; - given(packageScanner.apply(RuleSource.CHECKSTYLE)).willReturn(Stream.of(checkstyleClass)); + given(packageScanner.apply(RuleSource.CHECKSTYLE)).willReturn(singletonList(checkstyleClass)); final String sevntuClass = "sevntu class"; - given(packageScanner.apply(RuleSource.SEVNTU)).willReturn(Stream.of(sevntuClass)); + given(packageScanner.apply(RuleSource.SEVNTU)).willReturn(singletonList(sevntuClass)); //when final Map> checkClasses = new BuilderConfiguration().checkClasses(packageScanner); //then assertThat(checkClasses).containsOnlyKeys(RuleSource.values()); assertThat(checkClasses) - .containsEntry(RuleSource.CHECKSTYLE, Collections.singletonList(checkstyleClass)) - .containsEntry(RuleSource.SEVNTU, Collections.singletonList(sevntuClass)); + .containsEntry(RuleSource.CHECKSTYLE, singletonList(checkstyleClass)) + .containsEntry(RuleSource.SEVNTU, singletonList(sevntuClass)); } } diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScannerTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScannerTest.java index 240d12c..7b5a02e 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScannerTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScannerTest.java @@ -1,10 +1,8 @@ package net.kemitix.checkstyle.ruleset.builder; -import com.google.common.reflect.ClassPath; -import org.junit.Before; import org.junit.Test; -import java.io.IOException; +import java.util.List; import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; @@ -16,27 +14,21 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class DefaultPackageScannerTest { - private PackageScanner scanner; - - @Before - public void setUp() throws Exception { - final ClassPath classPath = ClassPath.from(getClass().getClassLoader()); - scanner = new DefaultPackageScanner(classPath); - } + private PackageScanner scanner = new DefaultPackageScanner(); @Test - public void canScanCheckstylePackage() throws IOException { + public void canScanCheckstylePackage() { //when - final Stream result = scanner.apply(RuleSource.CHECKSTYLE); + final List result = scanner.apply(RuleSource.CHECKSTYLE); //then assertThat(result).allMatch(cn -> cn.startsWith(RuleSource.CHECKSTYLE.getBasePackage())) .contains("com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck"); } @Test - public void canScanSevntuPackage() throws IOException { + public void canScanSevntuPackage() { //when - final Stream result = scanner.apply(RuleSource.SEVNTU); + final List result = scanner.apply(RuleSource.SEVNTU); //then assertThat(result).allMatch(cn -> cn.startsWith(RuleSource.SEVNTU.getBasePackage())) .contains("com.github.sevntu.checkstyle.checks.design.NestedSwitchCheck"); diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 280d970..0000000 --- a/circle.yml +++ /dev/null @@ -1,3 +0,0 @@ -test: - override: - - ./mvnw clean install diff --git a/pom.xml b/pom.xml index 4ed6fd9..7ae3307 100644 --- a/pom.xml +++ b/pom.xml @@ -5,8 +5,8 @@ 4.0.0 net.kemitix.checkstyle - root - 4.0.1 + kemitix-checkstyle-ruleset + 4.1.0 pom @@ -16,7 +16,6 @@ builder ruleset - regressions tile diff --git a/regressions/pom.xml b/regressions/pom.xml deleted file mode 100644 index 594633e..0000000 --- a/regressions/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 4.0.0 - - net.kemitix - kemitix-parent - 5.0.3 - - - - net.kemitix.checkstyle - regressions - 4.0.1 - - - true - 2.10 - 0.2.0 - - 8.6 - 1.26.0 - 3.0.0 - ${project.version} - - - 0-disabled - net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml - net.kemitix.checkstyle.regressions - true - 2.5.6 - - - - - org.immutables - value - ${immutables-value.version} - provided - - - - - - - io.repaint.maven - tiles-maven-plugin - ${tiles-maven-plugin.version} - true - - - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:compiler-tile:${kemitix-tiles.version} - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${maven-checkstyle-plugin.version} - - - com.puppycrawl.tools - checkstyle - ${checkstyle.version} - - - com.github.sevntu-checkstyle - sevntu-checkstyle-maven-plugin - ${sevntu.version} - - - net.kemitix.checkstyle - ruleset - ${kemitix.checkstyle.ruleset.version} - - - - ${kemitix.checkstyle.ruleset.location} - - - - verify - - check - - - - - - - - diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/AvoidDefaultSerializableInInnerClasses.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/AvoidDefaultSerializableInInnerClasses.java deleted file mode 100644 index 51f1157..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/AvoidDefaultSerializableInInnerClasses.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -import java.io.Serializable; - -/** - * Regression test for {@code AvoidDefaultSerializableInInnerClasses}. - * - * @author Paul Campbell (pcampbell@kemitix.net) - */ -public class AvoidDefaultSerializableInInnerClasses { - - /** - * Inner class should not use default implementations of {@code readObject()} and {@code writeObject()}. - */ - public class InnerClass implements Serializable { - - } - -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/Basic.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/Basic.java deleted file mode 100644 index f269c44..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/Basic.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -/** - * Sample class with no checkstyle issues. - * - * @author Paul Campbell (pcampbell@kemitix.net) - */ -class Basic { - -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/EmptyPublicCtorInClass.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/EmptyPublicCtorInClass.java deleted file mode 100644 index 0c49972..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/EmptyPublicCtorInClass.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -/** - * Regression demo for {@code EmptyPublicCtorInClassCheck}. - * - * @author Paul Campbell (pcampbell@kemitix.net) - */ -public class EmptyPublicCtorInClass { - - /** - * Useless empty public constructors. - */ - EmptyPublicCtorInClass() { - } - -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java deleted file mode 100644 index 9c20896..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/ExplicitInitialization.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -/** - * Regression demo for {@code ExplicitInitializationCheck}. - * - * @author Paul Campbell (pcampbell@kemitix.net). - */ -@SuppressWarnings({"hideutilityclassconstructor", "PMD.UnusedPrivateField"}) -class ExplicitInitialization { - - private boolean validBoolean = false; - - private int validInt = 0; - - private String validString = ""; - - private Object validObject = new Object(); - - private Boolean invalidBoolean = null; - - private Integer invalidInteger = null; - - private String invalidString = null; - - private Object invalidObject = null; - -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/FinalizeImplementation.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/FinalizeImplementation.java deleted file mode 100644 index 849afb7..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/FinalizeImplementation.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -/** - * Regression test for {@code FinalizeImplementationCheck}. - * - * @author Paul Campbell pcampbell@kemitix.net - */ -class FinalizeImplementation { - - /** - * Negates effect of superclass finalize. - */ - @SuppressWarnings("PMD.EmptyFinalizer") - protected void finalize() { - // doesn't call super.finalize() - } - -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java deleted file mode 100644 index 81c76d3..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -/** - * Regression demo for {@code MoveVariableInsideIfCheck}. - * - * @author Paul Campbell (pcampbell@kemitix.net) - */ -class MoveVariableInsideIf { - - private String input = "1"; - - private boolean condition; - - private String method(final String variable) { - return "value: " + variable; - } - - /** - * Fails if not suppressed. - * - * @return value - */ - protected String invalid() { - String variable = input.substring(1); - if (condition) { - return method(variable); - } - return ""; - } - - /** - * Rewrite {@link #invalid()} as this to pass. - * - * @return value - */ - protected String valid() { - if (condition) { - String variable = input.substring(1); - return method(variable); - } - return ""; - } -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/Values.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/Values.java deleted file mode 100644 index 30a8b17..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/Values.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; - -import org.immutables.value.Value; - -/** - * Regression subject for org.immutables. - * - * @author Paul Campbell (pcampbell@kemitix.net) - */ -@Value.Immutable -public interface Values { - - /** - * Gets the ID. - * - * @return the id - */ - @Value.Parameter - long getId(); - -} diff --git a/regressions/src/main/java/net/kemitix/checkstyle/regressions/package-info.java b/regressions/src/main/java/net/kemitix/checkstyle/regressions/package-info.java deleted file mode 100644 index e449fd3..0000000 --- a/regressions/src/main/java/net/kemitix/checkstyle/regressions/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Campbell - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.kemitix.checkstyle.regressions; diff --git a/ruleset/pom.xml b/ruleset/pom.xml index 5124525..fe8b1c9 100644 --- a/ruleset/pom.xml +++ b/ruleset/pom.xml @@ -7,13 +7,13 @@ net.kemitix kemitix-parent - 5.0.3 + 5.1.0 net.kemitix.checkstyle ruleset - 4.0.1 + 4.1.0 jar Kemitix Checkstyle Ruleset @@ -21,8 +21,8 @@ https://github.com/kemitix/kemitix-checkstyle-ruleset - 2.10 - 0.2.0 + 2.11 + 0.8.1 3.0.2 @@ -57,9 +57,8 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:enforcer-tile:${kemitix-tiles.version} - net.kemitix.tiles:release-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} + net.kemitix.tiles:enforcer:${kemitix-tiles.version} diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-1-layout.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-1-layout.xml index 4c5422e..5378d67 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-1-layout.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-1-layout.xml @@ -26,7 +26,6 @@ - diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml index 8b7de69..4125034 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml @@ -32,7 +32,6 @@ - diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml index 51a0531..2463ad3 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml @@ -38,7 +38,6 @@ - diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml index d9dbcb1..c30f4f8 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml @@ -46,7 +46,6 @@ - diff --git a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml index 87eebaa..374a07f 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml @@ -8,7 +8,9 @@ - + + + @@ -60,7 +62,6 @@ - @@ -97,9 +98,9 @@ - - - + + + @@ -110,10 +111,10 @@ - + - + diff --git a/set-version.sh b/set-version.sh old mode 100644 new mode 100755 index 717be2e..136b733 --- a/set-version.sh +++ b/set-version.sh @@ -12,4 +12,4 @@ NEXT=$2 echo Updating version from $CURRENT to $NEXT ./mvnw versions:set -DnewVersion=$NEXT -perl -p -i -e "s,$CURRENT net.kemitix kemitix-parent - 5.0.3 + 5.1.0 4.0.0 net.kemitix.checkstyle tile - 4.0.1 + 4.1.0 tile - 2.10 - 0.2.0 + 2.11 + 0.8.1 @@ -30,8 +30,7 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:release-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} diff --git a/tile/tile.xml b/tile/tile.xml index b347e8d..057ec1c 100644 --- a/tile/tile.xml +++ b/tile/tile.xml @@ -1,8 +1,8 @@ 3.0.0 - 8.6 - 1.26.0 + 8.10 + 1.29.0 4.0.1 5-complexity net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index b152705..0000000 --- a/wercker.yml +++ /dev/null @@ -1,6 +0,0 @@ -box: maven:3.5.0-jdk-8 - -build: - steps: - - xenoterracide/maven: - goals: clean install