From f469e5826597d1ee5f814fc399c014e36c12ca1d Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Sat, 18 Apr 2015 00:17:46 +0200 Subject: [PATCH] moved checkstyle rule --- conf/quality-config/cs-conf.xml | 15 +----- pom.xml | 46 +++++++++---------- .../PluralForCollectionVariable.java} | 6 +-- 3 files changed, 28 insertions(+), 39 deletions(-) rename src/test/java/qa/{PluralForCollectionVariableCheck.java => cs/PluralForCollectionVariable.java} (93%) diff --git a/conf/quality-config/cs-conf.xml b/conf/quality-config/cs-conf.xml index d2051928..1e33fb8d 100644 --- a/conf/quality-config/cs-conf.xml +++ b/conf/quality-config/cs-conf.xml @@ -465,7 +465,7 @@ <!-- Ensures that the setUp(), tearDown()methods are named correctly, have no arguments, !--> <!-- return void and are either public or protected. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> - <module name="JUnitTestCase"/> +<!-- <module name="JUnitTestCase"/> --> <!-- Checks that there are no "magic numbers", where a magic number is a numeric literal !--> <!-- that is not defined as a constant. !--> @@ -537,23 +537,12 @@ <!-- Ensure a class has a package declaration. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> <module name="PackageDeclaration"> - <property name="ignoreDirectoryName" value="false"/> </module> <!-- Disallow assignment of parameters. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> <module name="ParameterAssignment"/> - <!-- Checks for redundant exceptions declared in throws clause such as duplicates, !--> - <!-- unchecked exceptions or subclasses of another declared exception. !--> - <!-- See http://checkstyle.sf.net/config_coding.html !--> - <module name="RedundantThrows"> - <property name="allowUnchecked" value="true"/> - <property name="allowSubclasses" value="false"/> - <property name="logLoadErrors" value="true"/> - <property name="suppressLoadErrors" value="false"/> - </module> - <!-- Checks that code doesn't rely on the "this." default. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> <module name="RequireThis"> @@ -1211,7 +1200,7 @@ <property name="allowEmptyMethods" value="true"/> </module> - <module name="qa.PluralForCollectionVariableCheck" /> + <module name="qa.cs.PluralForCollectionVariable" /> </module> diff --git a/pom.xml b/pom.xml index c28aeb82..31906a9c 100644 --- a/pom.xml +++ b/pom.xml @@ -223,29 +223,29 @@ </configuration> </plugin> -<!-- Checkstyle --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.12</version> - <executions> - <execution> - <phase>test</phase> - <goals> - <goal>check</goal> - </goals> - <configuration> - <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> - <includeTestSourceDirectory>true</includeTestSourceDirectory> - <encoding>UTF-8</encoding> - <consoleOutput>true</consoleOutput> - <failsOnError>false</failsOnError> - <failOnViolation>false</failOnViolation> - <linkXRef>false</linkXRef> - </configuration> - </execution> - </executions> - </plugin> + <!-- Checkstyle --> +<!-- <plugin> --> +<!-- <groupId>org.apache.maven.plugins</groupId> --> +<!-- <artifactId>maven-checkstyle-plugin</artifactId> --> +<!-- <version>2.15</version> --> +<!-- <executions> --> +<!-- <execution> --> +<!-- <phase>test</phase> --> +<!-- <goals> --> +<!-- <goal>check</goal> --> +<!-- </goals> --> +<!-- <configuration> --> +<!-- <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> --> +<!-- <includeTestSourceDirectory>true</includeTestSourceDirectory> --> +<!-- <encoding>UTF-8</encoding> --> +<!-- <consoleOutput>true</consoleOutput> --> +<!-- <failsOnError>false</failsOnError> --> +<!-- <failOnViolation>false</failOnViolation> --> +<!-- <linkXRef>false</linkXRef> --> +<!-- </configuration> --> +<!-- </execution> --> +<!-- </executions> --> +<!-- </plugin> --> <!-- Findbugs --> <plugin> diff --git a/src/test/java/qa/PluralForCollectionVariableCheck.java b/src/test/java/qa/cs/PluralForCollectionVariable.java similarity index 93% rename from src/test/java/qa/PluralForCollectionVariableCheck.java rename to src/test/java/qa/cs/PluralForCollectionVariable.java index 91577379..85845dd0 100644 --- a/src/test/java/qa/PluralForCollectionVariableCheck.java +++ b/src/test/java/qa/cs/PluralForCollectionVariable.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package qa; +package qa.cs; import java.util.HashSet; import java.util.Set; @@ -22,11 +22,11 @@ import com.puppycrawl.tools.checkstyle.api.Check; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; -public class PluralForCollectionVariableCheck extends Check { +public class PluralForCollectionVariable extends Check { private final Set<String> collectionNames = new HashSet<String>(); - public PluralForCollectionVariableCheck() { + public PluralForCollectionVariable() { collectionNames.add("Collection"); collectionNames.add("Set"); collectionNames.add("List"); -- GitLab