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 new file mode 100644 index 0000000..197c38c --- /dev/null +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/BuilderConfiguration.java @@ -0,0 +1,49 @@ +/** + * 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.ruleset.builder; + +import com.google.common.reflect.ClassPath; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.io.IOException; + +/** + * Configuration for Builder. + * + * @author Paul Campbell (pcampbell@kemitix.net). + */ +@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()); + } +} 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 5e3558a..a9df0cd 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 @@ -55,6 +55,8 @@ class CheckstyleWriter implements CommandLineRunner { private final RulesProperties rulesProperties; + private final RuleClassLocator ruleClassLocator; + @Override public void run(final String... args) throws Exception { Stream.of(RuleLevel.values()) @@ -101,9 +103,9 @@ class CheckstyleWriter implements CommandLineRunner { private String formatRuleAsModule(final Rule rule) { if (rule.getProperties() .isEmpty()) { - return String.format("", rule.getCanonicalClassName()); + return String.format("", ruleClassLocator.apply(rule)); } - return String.format("%n %s%n", rule.getCanonicalClassName(), + return String.format("%n %s%n", ruleClassLocator.apply(rule), formatProperties(rule.getProperties()) ); } 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 new file mode 100644 index 0000000..aea4769 --- /dev/null +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScanner.java @@ -0,0 +1,47 @@ +/** + * 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.ruleset.builder; + +import com.google.common.reflect.ClassPath; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.stream.Stream; + +/** + * Default implementation of {@link PackageScanner}. + * + * @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); + } +} 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 new file mode 100644 index 0000000..6a91c6b --- /dev/null +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocator.java @@ -0,0 +1,77 @@ +/** + * 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.ruleset.builder; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.util.AbstractMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Default implementation of {@link RuleClassLocator}. + * + * @author Paul Campbell (pcampbell@kemitix.net). + */ +@Service +@RequiredArgsConstructor +public class DefaultRuleClassLocator implements RuleClassLocator { + + private final PackageScanner packageScanner; + + private Map> checkClasses; + + /** + * Initialise class lists for {@link RuleSource}s. + */ + @PostConstruct + public final void init() { + checkClasses = Stream.of(RuleSource.values()) + .map(source -> new AbstractMap.SimpleEntry<>( + source, packageScanner.apply(source) + .collect(Collectors.toList()))) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } + + @Override + public final String apply(final Rule rule) { + return getCanonicalClassName(rule.getSource(), rule.getName()); + } + + private String getCanonicalClassName(final RuleSource source, final String name) { + return checkClasses.get(source) + .stream() + .sorted() + .filter(classname -> byRuleName(classname, name)) + .findFirst() + .orElseThrow(() -> new CheckstyleClassNotFoundException(name)); + } + + private boolean byRuleName(final String classname, final String name) { + final String classNameWithDelimiter = "." + name; + return classname.endsWith(classNameWithDelimiter) || classname.endsWith(classNameWithDelimiter + "Check"); + } +} 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 new file mode 100644 index 0000000..7cc8c2b --- /dev/null +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/PackageScanner.java @@ -0,0 +1,34 @@ +/** + * 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.ruleset.builder; + +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> { + +} 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 70f9ae7..33c5624 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 @@ -103,22 +103,4 @@ public class Rule { private String getLowerCaseRuleName() { return getName().toLowerCase(LOCALE); } - - /** - * Returns the canonical name of the class that implements this rule. - * - * @return the canonical name of the implementing class - */ - public String getCanonicalClassName() { - return source.getCheckClasses() - .filter(this::byRuleName) - .findFirst() - .orElseThrow(() -> new CheckstyleClassNotFoundException(name)); - } - - private boolean byRuleName(final String classname) { - final String classNameWithDelimiter = "." + name; - return classname.endsWith(classNameWithDelimiter) || classname.endsWith(classNameWithDelimiter + "Check"); - } - } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleClassLocator.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleClassLocator.java new file mode 100644 index 0000000..14b7d50 --- /dev/null +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleClassLocator.java @@ -0,0 +1,33 @@ +/** + * 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.ruleset.builder; + +import java.util.function.Function; + +/** + * Returns the canonical name of the class that implements a {@link Rule}. + * + * @author Paul Campbell (pcampbell@kemitix.net). + */ +interface RuleClassLocator extends Function { + +} diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java index e10cb95..a74871e 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java @@ -21,14 +21,8 @@ package net.kemitix.checkstyle.ruleset.builder; -import com.google.common.reflect.ClassPath; import lombok.Getter; -import java.io.IOException; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - /** * The origin of the rule. * @@ -42,7 +36,6 @@ public enum RuleSource { @Getter private final String basePackage; - private final List checkClasses; /** * Constructor. @@ -51,19 +44,5 @@ public enum RuleSource { */ RuleSource(final String basePackage) { this.basePackage = basePackage; - try { - checkClasses = ClassPath.from(getClass().getClassLoader()) - .getTopLevelClassesRecursive(basePackage) - .stream() - .map(ClassPath.ClassInfo::getName) - .collect(Collectors.toList()); - } catch (IOException e) { - throw new CheckstyleSourceLoadException(basePackage, e); - } - } - - public Stream getCheckClasses() { - return checkClasses.stream() - .sorted(); } } diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java index 4c7547b..a409d3d 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/CheckstyleWriterTest.java @@ -6,6 +6,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; +import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.io.IOException; @@ -19,6 +20,8 @@ import java.util.List; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.any; /** * Tests for {@link CheckstyleWriter}. @@ -31,6 +34,12 @@ public class CheckstyleWriterTest { private static final String FILE_SEPARATOR = System.getProperty("file.separator"); + @org.junit.Rule + public ExpectedException exception = ExpectedException.none(); + + @org.junit.Rule + public TemporaryFolder folder = new TemporaryFolder(); + private CheckstyleWriter checkstyleWriter; private OutputProperties outputProperties; @@ -49,11 +58,8 @@ public class CheckstyleWriterTest { private Path checkstyleTemplate; - @org.junit.Rule - public ExpectedException exception = ExpectedException.none(); - - @org.junit.Rule - public TemporaryFolder folder = new TemporaryFolder(); + @Mock + private RuleClassLocator ruleClassLocator; @Before public void setUp() throws Exception { @@ -78,7 +84,14 @@ public class CheckstyleWriterTest { checkstyleTemplate, TEMPLATE.getBytes(StandardCharsets.UTF_8), StandardOpenOption.TRUNCATE_EXISTING); templateProperties.setCheckstyleXml(checkstyleTemplate); rulesProperties = new RulesProperties(); - checkstyleWriter = new CheckstyleWriter(outputProperties, templateProperties, rulesProperties); + checkstyleWriter = + new CheckstyleWriter(outputProperties, templateProperties, rulesProperties, ruleClassLocator); + given(ruleClassLocator.apply(any())).willReturn(ruleClassname); + } + + private Map.Entry getOutputFile(final RuleLevel level) throws IOException { + final String xmlFile = String.format("checkstyle-%s.xml", level.toString()); + return new AbstractMap.SimpleImmutableEntry<>(level, xmlFile); } // write rule that matches current level @@ -95,6 +108,23 @@ public class CheckstyleWriterTest { assertThat(lines).containsExactly("C:", String.format("TW:", ruleClassname)); } + private List loadOutputFile(final RuleLevel level) throws IOException { + val path = outputDirectory.resolve(outputFiles.get(level)); + assertThat(path).as("Output path exists") + .exists(); + return Files.readAllLines(path, StandardCharsets.UTF_8); + } + + private Rule enabledRule(final RuleLevel level, final RuleParent parent) { + val rule = new Rule(); + rule.setName(ruleName); + rule.setSource(RuleSource.CHECKSTYLE); + rule.setEnabled(true); + rule.setLevel(level); + rule.setParent(parent); + return rule; + } + // write rule that is below current level @Test public void writeRuleThatIsBelowCurrentLevel() throws Exception { @@ -192,26 +222,4 @@ public class CheckstyleWriterTest { //when checkstyleWriter.run(); } - - private Map.Entry getOutputFile(final RuleLevel level) throws IOException { - final String xmlFile = String.format("checkstyle-%s.xml", level.toString()); - return new AbstractMap.SimpleImmutableEntry<>(level, xmlFile); - } - - private List loadOutputFile(final RuleLevel level) throws IOException { - val path = outputDirectory.resolve(outputFiles.get(level)); - assertThat(path).as("Output path exists") - .exists(); - return Files.readAllLines(path, StandardCharsets.UTF_8); - } - - private Rule enabledRule(final RuleLevel level, final RuleParent parent) { - val rule = new Rule(); - rule.setName(ruleName); - rule.setSource(RuleSource.CHECKSTYLE); - rule.setEnabled(true); - rule.setLevel(level); - rule.setParent(parent); - return rule; - } } 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 new file mode 100644 index 0000000..978200e --- /dev/null +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultPackageScannerTest.java @@ -0,0 +1,46 @@ +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.stream.Stream; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link DefaultPackageScanner}. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +public class DefaultPackageScannerTest { + + private ClassPath classPath; + + private DefaultPackageScanner scanner; + + @Before + public void setUp() throws Exception { + classPath = ClassPath.from(getClass().getClassLoader()); + scanner = new DefaultPackageScanner(classPath); + } + + @Test + public void canScanCheckstylePackage() throws IOException { + //when + final Stream 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 { + //when + final Stream 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/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocatorTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocatorTest.java new file mode 100644 index 0000000..e8ea62a --- /dev/null +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/DefaultRuleClassLocatorTest.java @@ -0,0 +1,55 @@ +package net.kemitix.checkstyle.ruleset.builder; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.Collections; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.BDDMockito.given; + +/** + * Tests for {@link DefaultRuleClassLocator}. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +public class DefaultRuleClassLocatorTest { + + private DefaultRuleClassLocator subject; + + @Mock + private PackageScanner packageScanner; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + subject = new DefaultRuleClassLocator(packageScanner); + } + + @Test + public void canLookupRule() { + //given + final String rulename = "RegexpOnFilename"; + final String expected = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck"; + final List checkstyleClasses = Collections.singletonList(expected); + final List sevntuClasses = Collections.emptyList(); + given(packageScanner.apply(RuleSource.CHECKSTYLE)).willReturn(checkstyleClasses.stream()); + given(packageScanner.apply(RuleSource.SEVNTU)).willReturn(sevntuClasses.stream()); + subject.init(); + final Rule rule = createCheckstyleRule(rulename); + //when + final String result = subject.apply(rule); + //then + assertThat(result).isEqualTo(expected); + } + + private Rule createCheckstyleRule(final String rulename) { + final Rule rule = new Rule(); + rule.setSource(RuleSource.CHECKSTYLE); + rule.setName(rulename); + return rule; + } +} diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java index 3cf5562..47397a4 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java @@ -30,4 +30,16 @@ public class RuleSourceTest { //then assertThat(values).containsExactlyElementsOf(expected); } + + @Test + public void basePackages() { + //given + final String puppycrawl = "puppycrawl"; + final String sevntu = "sevntu"; + //then + assertThat(RuleSource.CHECKSTYLE.getBasePackage()).contains(puppycrawl) + .doesNotContain(sevntu); + assertThat(RuleSource.SEVNTU.getBasePackage()).contains(sevntu) + .doesNotContain(puppycrawl); + } } 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 7dd6341..dcb2199 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-1-layout.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-1-layout.xml @@ -63,4 +63,3 @@ - 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 8388113..a4a70a0 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-2-naming.xml @@ -95,4 +95,3 @@ - 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 4b469d9..5536268 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-3-javadoc.xml @@ -121,4 +121,3 @@ - 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 a6ad5cc..4a5e460 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-4-tweaks.xml @@ -180,4 +180,3 @@ - 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 f486e8c..7181911 100644 --- a/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml +++ b/ruleset/src/main/resources/net/kemitix/checkstyle-5-complexity.xml @@ -233,4 +233,3 @@ -