From 426e3b25fe6067855ab67a72f5a651ce157a70ec Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 13 Mar 2021 17:34:51 +0000 Subject: [PATCH] Bump spring-boot.version from 2.3.5.RELEASE to 2.4.3 (#378) * Bump spring-boot.version from 2.3.5.RELEASE to 2.4.3 Bumps `spring-boot.version` from 2.3.5.RELEASE to 2.4.3. Updates `spring-boot-dependencies` from 2.3.5.RELEASE to 2.4.3 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.3.5.RELEASE...v2.4.3) Updates `spring-boot-maven-plugin` from 2.3.5.RELEASE to 2.4.3 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.3.5.RELEASE...v2.4.3) Signed-off-by: dependabot-preview[bot] * Version set to 5.5.0 * Bump kemitix-maven-tiles from 2.7.0 to 3.0.1 * Various PMD, checkstyle and FindBugs fixes * buildeR: disable coverage checks * readme: updated * Remove disable rule * Add reason for disabled rule Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Paul Campbell --- README.md | 10 ++++----- builder/pom.xml | 22 +++++++++---------- .../CheckstyleClassNotFoundException.java | 2 ++ .../CheckstyleRulesetBuilderApplication.java | 4 ++-- .../CheckstyleSourceLoadException.java | 2 ++ .../ruleset/builder/CheckstyleWriter.java | 20 +++++++++++------ .../builder/CheckstyleWriterException.java | 2 ++ .../builder/ClassGraphPackageScanner.java | 2 +- .../builder/DefaultReadmeIndexBuilder.java | 1 - .../builder/DefaultRuleClassLocator.java | 16 +++++--------- .../builder/DefaultRuleReadmeLoader.java | 6 +++-- .../ruleset/builder/ReadmeBuilder.java | 12 ++++------ .../ReadmeFragmentNotFoundException.java | 2 ++ .../ruleset/builder/ReadmeIndexBuilder.java | 2 +- .../ruleset/builder/ReadmeWriter.java | 12 +++++----- .../checkstyle/ruleset/builder/Rule.java | 12 +++++----- .../ruleset/builder/RuleLoader.java | 2 +- .../ruleset/builder/RuleReadmeLoader.java | 2 +- .../ruleset/builder/SourcesProperties.java | 8 ++++++- .../builder/TemplateNotFoundException.java | 2 ++ builder/src/main/resources/application.yml | 1 + pom.xml | 2 +- ruleset/pom.xml | 5 ++--- .../net/kemitix/checkstyle-4-tweaks.xml | 1 - .../net/kemitix/checkstyle-5-complexity.xml | 1 - tile/pom.xml | 4 ++-- 26 files changed, 83 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index b8cfe3b..b27863c 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ Rule|Level|Source|Enabled|Suppressible [InnerAssignment](#innerassignment)|tweaks|checkstyle|Yes| [InnerTypeLast](#innertypelast)|tweaks|checkstyle|Yes| [InterfaceIsType](#interfaceistype)|complexity|checkstyle|Yes| -[InterfaceMemberImpliedModifier](#interfacememberimpliedmodifier)|tweaks|checkstyle|Yes| +[InterfaceMemberImpliedModifier](#interfacememberimpliedmodifier)|tweaks|checkstyle|| [InterfaceTypeParameterName](#interfacetypeparametername)|naming|checkstyle|Yes| [JavadocMethod](#javadocmethod)|javadoc|checkstyle|| [JavadocPackage](#javadocpackage)|javadoc|checkstyle|Yes| @@ -1115,11 +1115,6 @@ interface Foo { static final String "Foo!!"; } ```` -#### [InterfaceMemberImpliedModifier](http://checkstyle.sourceforge.net/config_modifier.html#InterfaceMemberImpliedModifier) - -Checks that members of an interface explicitly state their modifiers. From Java 9 the implied modifiers for members -are different depending on whether they are on a class or an interface. Explicitly stating the modifiers removes the -need for the developer to remember the differences. #### [InterfaceTypeParameterName](http://checkstyle.sourceforge.net/config_naming.html#InterfaceTypeParameterName) Checks that the type parameters for an interface are a single uppercase letter. @@ -2121,6 +2116,9 @@ Generic rule; doesn't embody a 'quality' check. #### [Indentation](http://checkstyle.sourceforge.net/config_misc.html#Indentation) Couldn't get my IDE's (IntelliJ) code style to match. +#### [InterfaceMemberImpliedModifier](http://checkstyle.sourceforge.net/config_modifier.html#InterfaceMemberImpliedModifier) + +Makes interfaces overly verbose. #### [JavadocMethod](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocMethod) Only exceptional cases should need to be documented. diff --git a/builder/pom.xml b/builder/pom.xml index bf1e1bf..2e75e1d 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -14,7 +14,7 @@ net.kemitix.checkstyle builder jar - 5.4.1 + 5.5.0 true @@ -22,14 +22,14 @@ ${java.version} ${java.version} 2.19 - 2.7.0 + 3.0.1 8.41 1.38.0 1.35.0 1.18.18 Brussels-SR6 - 2.3.5.RELEASE + 2.4.3 3.2.10 1.0.0 3.8.0 @@ -145,14 +145,14 @@ true - net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} - net.kemitix.tiles:enforcer:${kemitix-tiles.version} - net.kemitix.tiles:compiler-jdk-11:${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} + net.kemitix.tiles:maven-plugins:${kemitix-maven-tiles.version} + net.kemitix.tiles:compiler-jdk-lts:${kemitix-maven-tiles.version} + net.kemitix.tiles:pmd:${kemitix-maven-tiles.version} + net.kemitix.tiles:testing:${kemitix-maven-tiles.version} + net.kemitix.tiles:spotbugs:${kemitix-maven-tiles.version} + + net.kemitix.tiles:pitest:${kemitix-maven-tiles.version} + net.kemitix.tiles:pmd-strict:${kemitix-maven-tiles.version} diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleClassNotFoundException.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleClassNotFoundException.java index 7767b57..8db8e46 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleClassNotFoundException.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleClassNotFoundException.java @@ -7,6 +7,8 @@ package net.kemitix.checkstyle.ruleset.builder; */ public class CheckstyleClassNotFoundException extends RuntimeException { + private static final long serialVersionUID = -4752607844086418212L; + /** * Constructor. * diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java index 55e92f9..08c1c9a 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleRulesetBuilderApplication.java @@ -14,8 +14,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties */ @EnableConfigurationProperties({RulesProperties.class, OutputProperties.class}) @SpringBootApplication -@SuppressWarnings("hideutilityclassconstructor") -public class CheckstyleRulesetBuilderApplication { +@SuppressWarnings({"hideutilityclassconstructor", "PMD.AbstractClassWithoutAbstractMethod"}) +public abstract class CheckstyleRulesetBuilderApplication { /** * Main methods. diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleSourceLoadException.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleSourceLoadException.java index 3101c70..1fb6c76 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleSourceLoadException.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleSourceLoadException.java @@ -9,6 +9,8 @@ import java.io.IOException; */ public class CheckstyleSourceLoadException extends RuntimeException { + private static final long serialVersionUID = 4770223195735989937L; + /** * Constructor. * 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 50533cc..0dbe694 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 @@ -1,5 +1,6 @@ package net.kemitix.checkstyle.ruleset.builder; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.CommandLineRunner; @@ -31,18 +32,22 @@ class CheckstyleWriter implements CommandLineRunner { private final OutputProperties outputProperties; - private final TemplateProperties templateProperties; + private final TemplateProperties templateProps; private final RulesProperties rulesProperties; private final RuleClassLocator ruleClassLocator; private final SourcesProperties sourcesProperties; - private final Set enabledSourceNames = new HashSet<>(); + private final Set enabledNames = new HashSet<>(); + + /** + * Builds list of enabled sources. + */ @PostConstruct public void init() { - enabledSourceNames.addAll( + enabledNames.addAll( sourcesProperties.getSources() .stream() .filter(RuleSource::isEnabled) @@ -51,7 +56,7 @@ class CheckstyleWriter implements CommandLineRunner { } private static Predicate excludeUnspecifiedRuleLevel() { - return level -> !level.equals(RuleLevel.UNSPECIFIED); + return level -> level != RuleLevel.UNSPECIFIED; } private static void writeRuleset( @@ -81,7 +86,7 @@ class CheckstyleWriter implements CommandLineRunner { ) throws IOException { if (fileExists(template.toFile())) { log.info("Writing ruleset: {}", outputPath); - final String xmlTemplate = new String(Files.readAllBytes(template), StandardCharsets.UTF_8); + final String xmlTemplate = Files.readString(template); writeRuleset(outputPath, ruleset(checkerRules, treeWalkerRules, xmlTemplate)); } else { throw new TemplateNotFoundException(template); @@ -95,11 +100,12 @@ class CheckstyleWriter implements CommandLineRunner { .forEach(this::writeCheckstyleFile); } + @SuppressFBWarnings("EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS") private void writeCheckstyleFile(final RuleLevel ruleLevel) { final Path outputPath = outputPath(ruleLevel); final String checkerRules = enabledRules(ruleLevel, RuleParent.CHECKER); final String treeWalkerRules = enabledRules(ruleLevel, RuleParent.TREEWALKER); - final Path template = templateProperties.getCheckstyleXml(); + final Path template = templateProps.getCheckstyleXml(); try { writeCheckstyleFileWithException(outputPath, checkerRules, treeWalkerRules, template); } catch (IOException e) { @@ -120,7 +126,7 @@ class CheckstyleWriter implements CommandLineRunner { return rulesProperties.getRules() .stream() .filter(Rule::isEnabled) - .filter(rule -> enabledSourceNames.contains(rule.getSource())) + .filter(rule -> enabledNames.contains(rule.getSource())) .filter(Rule.hasParent(ruleParent)) .filter(Rule.isIncludedInLevel(ruleLevel)) .map(rule -> Rule.asModule(ruleClassLocator.apply(rule), rule)) diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterException.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterException.java index 50cd635..1c86fa1 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterException.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterException.java @@ -7,6 +7,8 @@ package net.kemitix.checkstyle.ruleset.builder; */ class CheckstyleWriterException extends RuntimeException { + private static final long serialVersionUID = -2351827809632216096L; + /** * Constructor. * diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ClassGraphPackageScanner.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ClassGraphPackageScanner.java index 94566f3..169722b 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ClassGraphPackageScanner.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ClassGraphPackageScanner.java @@ -17,7 +17,7 @@ import java.util.stream.Collectors; @Service public class ClassGraphPackageScanner implements PackageScanner { - private final ClassGraph classGraph = new ClassGraph(); + private final transient ClassGraph classGraph = new ClassGraph(); @Override public final List apply(final RuleSource ruleSource) { diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultReadmeIndexBuilder.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultReadmeIndexBuilder.java index 67a5e2e..baf80ed 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultReadmeIndexBuilder.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultReadmeIndexBuilder.java @@ -57,7 +57,6 @@ public class DefaultReadmeIndexBuilder implements ReadmeIndexBuilder { private String source(final Rule rule) { return rule.getSource() - .toString() .toLowerCase(LOCALE); } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocator.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocator.java index 9891dc3..d457d05 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocator.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocator.java @@ -1,5 +1,6 @@ package net.kemitix.checkstyle.ruleset.builder; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.List; @@ -13,19 +14,12 @@ import java.util.Objects; * @author Paul Campbell (pcampbell@kemitix.net). */ @Service -//@RequiredArgsConstructor +@RequiredArgsConstructor public class DefaultRuleClassLocator implements RuleClassLocator { private final Map> checkClasses; private final SourcesProperties sourcesProperties; - public DefaultRuleClassLocator( - final Map> checkClasses, - final SourcesProperties sourcesProperties) { - this.checkClasses = checkClasses; - this.sourcesProperties = sourcesProperties; - } - @Override public final String apply(final Rule rule) { return getCanonicalClassName(rule.getSource(), rule.getName()); @@ -50,8 +44,8 @@ public class DefaultRuleClassLocator implements RuleClassLocator { final String classname, final String name ) { - final String classNameWithDelimiter = "." + name; - return classname.endsWith(classNameWithDelimiter) - || classname.endsWith(classNameWithDelimiter + "Check"); + final String delimitedName = "." + name; + return classname.endsWith(delimitedName) + || classname.endsWith(delimitedName + "Check"); } } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleReadmeLoader.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleReadmeLoader.java index 7202231..5357e41 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleReadmeLoader.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleReadmeLoader.java @@ -1,5 +1,6 @@ package net.kemitix.checkstyle.ruleset.builder; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -19,13 +20,14 @@ import java.util.stream.Stream; @RequiredArgsConstructor class DefaultRuleReadmeLoader implements RuleReadmeLoader { - private final TemplateProperties templateProperties; + private final TemplateProperties templateProps; @Override + @SuppressFBWarnings("EXS_EXCEPTION_SOFTENING_NO_CHECKED") public Stream load(final Rule rule) { if (rule.isEnabled()) { final Path resolve = - templateProperties.getReadmeFragments() + templateProps.getReadmeFragments() .resolve(rule.getName() + ".md"); log.info("Loading fragment: {}", resolve); try { diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeBuilder.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeBuilder.java index 847fddb..7b5f86c 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeBuilder.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeBuilder.java @@ -21,16 +21,12 @@ public class ReadmeBuilder { * @return the formatted readme document. */ public String build(final String readmeTemplate) { - String enabledCheckstyle = ruleLoader.loadEnabled(CHECKSTYLE); - String enabledSevntu = ruleLoader.loadEnabled(SEVNTU); - String disabledCheckstyle = ruleLoader.loadDisabled(CHECKSTYLE); - String disabledSevntu = ruleLoader.loadDisabled(SEVNTU); return String.format(readmeTemplate, indexBuilder.build(), - enabledCheckstyle, - enabledSevntu, - disabledCheckstyle, - disabledSevntu); + ruleLoader.loadEnabled(CHECKSTYLE), + ruleLoader.loadEnabled(SEVNTU), + ruleLoader.loadDisabled(CHECKSTYLE), + ruleLoader.loadDisabled(SEVNTU)); } } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeFragmentNotFoundException.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeFragmentNotFoundException.java index d518670..ed37294 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeFragmentNotFoundException.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeFragmentNotFoundException.java @@ -7,6 +7,8 @@ package net.kemitix.checkstyle.ruleset.builder; */ class ReadmeFragmentNotFoundException extends RuntimeException { + private static final long serialVersionUID = 1947381338394993108L; + /** * Constructor. * diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeIndexBuilder.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeIndexBuilder.java index 8d18fc3..865c556 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeIndexBuilder.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeIndexBuilder.java @@ -12,5 +12,5 @@ public interface ReadmeIndexBuilder { * * @return The rule index. */ - public abstract String build(); + String build(); } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java index b4995bf..d451a27 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java @@ -1,5 +1,6 @@ package net.kemitix.checkstyle.ruleset.builder; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import net.kemitix.files.FileReaderWriter; import org.springframework.boot.CommandLineRunner; @@ -17,17 +18,18 @@ import java.nio.file.Paths; @RequiredArgsConstructor class ReadmeWriter implements CommandLineRunner { - private final TemplateProperties templateProperties; + private final TemplateProperties templateProps; private final OutputProperties outputProperties; private final ReadmeBuilder readmeBuilder; private final FileReaderWriter fileReaderWriter; @Override + @SuppressFBWarnings("PATH_TRAVERSAL_IN") public void run(final String... args) throws Exception { - File templateFile = templateProperties.getReadmeTemplate(); - String templateBody = fileReaderWriter.read(templateFile); - File outputFile = Paths.get(outputProperties.getReadme()).toFile(); - String outputBody = readmeBuilder.build(templateBody); + final File templateFile = templateProps.getReadmeTemplate(); + final String templateBody = fileReaderWriter.read(templateFile); + final File outputFile = Paths.get(outputProperties.getReadme()).toFile(); + final String outputBody = readmeBuilder.build(templateBody); fileReaderWriter.write(outputFile, outputBody); } 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 dc34fe5..8b9e78f 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 @@ -23,13 +23,14 @@ public class Rule { private static final Locale LOCALE = Locale.ENGLISH; - private static final String MODULE_NO_PROPERTIES = ""; + private static final String NO_PROPERTIES = ""; - private static final String MODULE_WITH_PROPERTIES = "%n%s%n"; + private static final String WITH_PROPERTIES = "%n%s%n"; /** * Configuration properties. */ + @SuppressWarnings("PMD.UseConcurrentHashMap") private final Map properties = new HashMap<>(); /** @@ -95,10 +96,9 @@ public class Rule { * @return a Predicate to check a Rule */ static Predicate hasParent(final RuleParent ruleParent) { - return rule -> ruleParent.equals(rule.getParent()); + return rule -> ruleParent == rule.getParent(); } - /** * Predicate to check that the Rule is included in the given RuleLevel. * @@ -143,14 +143,14 @@ public class Rule { private static String moduleNoParameters( final String ruleClassname ) { - return String.format(MODULE_NO_PROPERTIES, ruleClassname); + return String.format(NO_PROPERTIES, ruleClassname); } private static String moduleWithParameters( final Rule rule, final String ruleClassname ) { - return String.format(MODULE_WITH_PROPERTIES, ruleClassname, formatProperties(rule.getProperties())); + return String.format(WITH_PROPERTIES, ruleClassname, formatProperties(rule.getProperties())); } /** diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLoader.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLoader.java index b458e9c..94141b2 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLoader.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleLoader.java @@ -40,7 +40,7 @@ public class RuleLoader { * @return a formatted string containing the disabled rules. */ public String loadDisabled(final String sourceName) { - boolean enabledRuleSource = isEnabledRuleSource(sourceName); + final boolean enabledRuleSource = isEnabledRuleSource(sourceName); return readmeRules(rule -> rule.isFromSource(sourceName) && (!enabledRuleSource || !rule.isEnabled())); diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleReadmeLoader.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleReadmeLoader.java index 3c7b2fc..85dd161 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleReadmeLoader.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleReadmeLoader.java @@ -17,5 +17,5 @@ interface RuleReadmeLoader { * * @return A Stream of the readme fragment. */ - public abstract Stream load(Rule rule); + Stream load(Rule rule); } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/SourcesProperties.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/SourcesProperties.java index eaf962b..d9d7cd7 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/SourcesProperties.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/SourcesProperties.java @@ -17,11 +17,17 @@ import java.util.Optional; @Setter @Getter @Configuration -@ConfigurationProperties +@ConfigurationProperties("") class SourcesProperties { private List sources = new ArrayList<>(); + /** + * Search for a RuleSource by name. + * + * @param sourceName the name of the source + * @return an Optional containing the RuleSource if found + */ public Optional findSource(final String sourceName) { return sources.stream() .filter(ruleSource -> ruleSource.getName().equals(sourceName)) diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateNotFoundException.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateNotFoundException.java index 277e903..46e69f6 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateNotFoundException.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateNotFoundException.java @@ -9,6 +9,8 @@ import java.nio.file.Path; */ class TemplateNotFoundException extends RuntimeException { + private static final long serialVersionUID = -5054401608077696337L; + /** * Constructor. * diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 7925a3b..8e7b58f 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -430,6 +430,7 @@ rules: enabled: false source: CHECKSTYLE uri: http://checkstyle.sourceforge.net/config_modifier.html#InterfaceMemberImpliedModifier + reason: Makes interfaces overly verbose. - name: InterfaceTypeParameterName parent: TREEWALKER diff --git a/pom.xml b/pom.xml index bf73142..b850514 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.kemitix.checkstyle kemitix-checkstyle-ruleset - 5.4.1 + 5.5.0 pom diff --git a/ruleset/pom.xml b/ruleset/pom.xml index 7d9234b..21a862f 100644 --- a/ruleset/pom.xml +++ b/ruleset/pom.xml @@ -13,7 +13,7 @@ net.kemitix.checkstyle ruleset - 5.4.1 + 5.5.0 jar Kemitix Checkstyle Ruleset @@ -22,7 +22,7 @@ 2.19 - 2.7.0 + 3.0.1 @@ -57,7 +57,6 @@ 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-4-tweaks.xml b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml index 9bcaea8..98655a6 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml @@ -66,7 +66,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 81575db..b8cbb31 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml @@ -86,7 +86,6 @@ - diff --git a/tile/pom.xml b/tile/pom.xml index 9bfb941..ab347ee 100644 --- a/tile/pom.xml +++ b/tile/pom.xml @@ -12,13 +12,13 @@ net.kemitix.checkstyle tile - 5.4.1 + 5.5.0 tile 2.19 - 2.7.0 + 3.0.1 3.1.2 8.41