Merge pull request #84 from kemitix/drop-regressions

Remove regressions module - not adding anything valuable
This commit is contained in:
Paul Campbell 2018-05-14 20:34:28 +01:00 committed by GitHub
commit 8f6a8201c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1 additions and 424 deletions

View file

@ -2332,8 +2332,6 @@ if (condition) {
} }
return ""; 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) #### [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`. Checks the names of JUnit test classes. Classes checked are those that have at least one method annotated with `Test` or `org.junit.Test`.

View file

@ -18,5 +18,3 @@ if (condition) {
} }
return ""; return "";
```` ````
Example: [MoveVariableInsideIf.java](https://github.com/kemitix/kemitix-checkstyle-ruleset/blob/master/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java)

View file

@ -16,7 +16,6 @@
<modules> <modules>
<module>builder</module> <module>builder</module>
<module>ruleset</module> <module>ruleset</module>
<module>regressions</module>
<module>tile</module> <module>tile</module>
</modules> </modules>

View file

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId>
<version>5.1.0</version>
<relativePath/>
</parent>
<groupId>net.kemitix.checkstyle</groupId>
<artifactId>regressions</artifactId>
<version>4.1.0-SNAPSHOT</version>
<properties>
<maven.install.skip>true</maven.install.skip>
<tiles-maven-plugin.version>2.11</tiles-maven-plugin.version>
<kemitix-tiles.version>0.8.1</kemitix-tiles.version>
<java.version>1.8</java.version>
<checkstyle.version>8.10</checkstyle.version>
<sevntu.version>1.29.0</sevntu.version>
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version>
<!--<kemitix.checkstyle.ruleset.level>5-complexity</kemitix.checkstyle.ruleset.level>-->
<!-- use the disabled ruleset for normal builds. comment out the following line to check that conditions are caught -->
<kemitix.checkstyle.ruleset.level>0-disabled</kemitix.checkstyle.ruleset.level>
<kemitix.checkstyle.ruleset.location>net/kemitix/checkstyle-${kemitix.checkstyle.ruleset.level}.xml</kemitix.checkstyle.ruleset.location>
<digraph-dependency.basePackage>net.kemitix.checkstyle.regressions</digraph-dependency.basePackage>
<pitest.skip>true</pitest.skip>
<immutables-value.version>2.5.6</immutables-value.version>
</properties>
<dependencies>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>${immutables-value.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>${tiles-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>net.kemitix.tiles:maven-plugins:${kemitix-tiles.version}</tile>
<tile>net.kemitix.tiles:compiler:${kemitix-tiles.version}</tile>
</tiles>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
<dependency>
<groupId>com.github.sevntu-checkstyle</groupId>
<artifactId>sevntu-checkstyle-maven-plugin</artifactId>
<version>${sevntu.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.checkstyle</groupId>
<artifactId>ruleset</artifactId>
<version>${kemitix.checkstyle.ruleset.version}</version>
</dependency>
</dependencies>
<configuration>
<configLocation>${kemitix.checkstyle.ruleset.location}</configLocation>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -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 {
}
}

View file

@ -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 {
}

View file

@ -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() {
}
}

View file

@ -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;
}

View file

@ -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()
}
}

View file

@ -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 "";
}
}

View file

@ -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();
}

View file

@ -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;

View file

@ -12,4 +12,4 @@ NEXT=$2
echo Updating version from $CURRENT to $NEXT echo Updating version from $CURRENT to $NEXT
./mvnw versions:set -DnewVersion=$NEXT ./mvnw versions:set -DnewVersion=$NEXT
perl -p -i -e "s,$CURRENT</,$NEXT</," builder/pom.xml builder/src/main/resources/README-template.md regressions/pom.xml ruleset/pom.xml tile/pom.xml tile/tile.xml perl -p -i -e "s,$CURRENT</,$NEXT</," builder/pom.xml builder/src/main/resources/README-template.md ruleset/pom.xml tile/pom.xml tile/tile.xml