Moving the usage checks to the contrib directory. I have cloned the
directory structure that was used.
This commit is contained in:
parent
3d281a9683
commit
28193fd5f0
|
|
@ -31,7 +31,7 @@
|
|||
<property name="xdocs.dest" value="target/docs"/>
|
||||
<property name="checkstyle.minimum.javaversion" value="1.4" />
|
||||
<property name="checkstyle.testinputs.minimum.javaversion" value="1.5" />
|
||||
<property name="version" value="4.0-beta4" />
|
||||
<property name="version" value="4.0-beta5" />
|
||||
|
||||
<path id="build.classpath">
|
||||
<pathelement location="${antlr.jar}" />
|
||||
|
|
@ -231,7 +231,6 @@
|
|||
</instrpath>
|
||||
<filter excludes="com.puppycrawl.tools.checkstyle.doclets.*"/>
|
||||
<filter excludes="com.puppycrawl.tools.checkstyle.gui.*"/>
|
||||
<filter excludes="com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.*"/>
|
||||
<filter excludes="com.puppycrawl.tools.checkstyle.grammars.*"/>
|
||||
</instr>
|
||||
</emma>
|
||||
|
|
@ -464,11 +463,11 @@ For users of JDK 1.5 at least version 1.6.2 of Ant is required.
|
|||
<mkdir dir="${dist.dir}/checkstyle-${version}" />
|
||||
<jar jarfile="${dist.dir}/checkstyle-${version}/checkstyle-${version}.jar"
|
||||
basedir="target/checkstyle"
|
||||
excludes="**/usage/**, **/j2ee/**"
|
||||
excludes="**/j2ee/**"
|
||||
manifest="config/manifest.mf" />
|
||||
<jar jarfile="${dist.dir}/checkstyle-${version}/checkstyle-optional-${version}.jar"
|
||||
basedir="target/checkstyle"
|
||||
includes="**/usage/**, **/j2ee/**"/>
|
||||
includes="**/j2ee/**"/>
|
||||
<!-- copy the JARS and make a mega JAR out of them -->
|
||||
<copy file="${antlr.jar}" todir="${dist.dir}/checkstyle-${version}" />
|
||||
<copy file="${beanutils.jar}" todir="${dist.dir}/checkstyle-${version}" />
|
||||
|
|
@ -585,7 +584,6 @@ For users of JDK 1.5 at least version 1.6.2 of Ant is required.
|
|||
<exclude name="**/Generated*.txt" />
|
||||
<exclude name="**/gui/*.java" />
|
||||
<exclude name="**/checks/**"/>
|
||||
<exclude name="**/usage/transmogrify/*.java" />
|
||||
<exclude name="**/*.properties" />
|
||||
<exclude name="**/*.g" />
|
||||
<exclude name="**/*.dtd" />
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public class AllTests {
|
|||
suite.addTest(com.puppycrawl.tools.checkstyle.checks.metrics.AllTests.suite());
|
||||
suite.addTest(com.puppycrawl.tools.checkstyle.checks.naming.AllTests.suite());
|
||||
suite.addTest(com.puppycrawl.tools.checkstyle.checks.sizes.AllTests.suite());
|
||||
suite.addTest(com.puppycrawl.tools.checkstyle.checks.usage.AllTests.suite());
|
||||
suite.addTest(com.puppycrawl.tools.checkstyle.checks.whitespace.AllTests.suite());
|
||||
|
||||
return suite;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.puppycrawl.tools.checkstyle.checks.FileContentsHolder;
|
|||
import com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.usage.UnusedParameterCheck;
|
||||
|
||||
public class SuppressionCommentFilterTest
|
||||
extends BaseCheckTestCase
|
||||
|
|
@ -37,8 +36,6 @@ public class SuppressionCommentFilterTest
|
|||
"38:17: Name 'R' must match pattern '^[a-z][a-zA-Z0-9]*$'.",
|
||||
"39:30: Name 's' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.",
|
||||
"43:17: Name 'T' must match pattern '^[a-z][a-zA-Z0-9]*$'.",
|
||||
"47:34: Unused parameter 'aInt'.",
|
||||
"51:34: Unused parameter 'aInt'.",
|
||||
"64:23: Catching 'Exception' is not allowed.",
|
||||
"71:11: Catching 'Exception' is not allowed.",
|
||||
};
|
||||
|
|
@ -55,7 +52,7 @@ public class SuppressionCommentFilterTest
|
|||
//Supress all checks between default comments
|
||||
public void testDefault() throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
final String[] suppressed = {
|
||||
"16:17: Name 'J' must match pattern '^[a-z][a-zA-Z0-9]*$'.",
|
||||
|
|
@ -68,7 +65,7 @@ public class SuppressionCommentFilterTest
|
|||
|
||||
public void testCheckC() throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
filterConfig.addAttribute("checkC", "false");
|
||||
final String[] suppressed = {
|
||||
|
|
@ -81,7 +78,7 @@ public class SuppressionCommentFilterTest
|
|||
|
||||
public void testCheckCPP() throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
filterConfig.addAttribute("checkCPP", "false");
|
||||
final String[] suppressed = {
|
||||
|
|
@ -93,7 +90,7 @@ public class SuppressionCommentFilterTest
|
|||
//Supress all checks between CS_OFF and CS_ON
|
||||
public void testOffFormat() throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
filterConfig.addAttribute("offCommentFormat", "CS_OFF");
|
||||
filterConfig.addAttribute("onCommentFormat", "CS_ON");
|
||||
|
|
@ -107,10 +104,10 @@ public class SuppressionCommentFilterTest
|
|||
}
|
||||
|
||||
//Test supression of checks of only one type
|
||||
//Supress only ConstantNameCheck between CS_OFF and CS_ON
|
||||
//Supress only ConstantNameCheck between CS_OFF and CS_ON
|
||||
public void testOffFormatCheck() throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
filterConfig.addAttribute("offCommentFormat", "CS_OFF");
|
||||
filterConfig.addAttribute("onCommentFormat", "CS_ON");
|
||||
|
|
@ -125,7 +122,7 @@ public class SuppressionCommentFilterTest
|
|||
public void testExpansion()
|
||||
throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
filterConfig.addAttribute("offCommentFormat", "CSOFF\\: ([\\w\\|]+)");
|
||||
filterConfig.addAttribute("onCommentFormat", "CSON\\: ([\\w\\|]+)");
|
||||
|
|
@ -141,7 +138,7 @@ public class SuppressionCommentFilterTest
|
|||
public void testMessage()
|
||||
throws Exception
|
||||
{
|
||||
final DefaultConfiguration filterConfig =
|
||||
final DefaultConfiguration filterConfig =
|
||||
createFilterConfig(SuppressionCommentFilter.class);
|
||||
filterConfig.addAttribute("onCommentFormat", "UNUSED ON\\: (\\w+)");
|
||||
filterConfig.addAttribute("offCommentFormat", "UNUSED OFF\\: (\\w+)");
|
||||
|
|
@ -170,13 +167,12 @@ public class SuppressionCommentFilterTest
|
|||
protected Checker createChecker(Configuration aFilterConfig)
|
||||
throws CheckstyleException
|
||||
{
|
||||
final DefaultConfiguration checkerConfig =
|
||||
final DefaultConfiguration checkerConfig =
|
||||
new DefaultConfiguration("configuration");
|
||||
final DefaultConfiguration checksConfig = createCheckConfig(TreeWalker.class);
|
||||
checksConfig.addChild(createCheckConfig(FileContentsHolder.class));
|
||||
checksConfig.addChild(createCheckConfig(MemberNameCheck.class));
|
||||
checksConfig.addChild(createCheckConfig(ConstantNameCheck.class));
|
||||
checksConfig.addChild(createCheckConfig(UnusedParameterCheck.class));
|
||||
checksConfig.addChild(createCheckConfig(IllegalCatchCheck.class));
|
||||
checkerConfig.addChild(checksConfig);
|
||||
if (aFilterConfig != null) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,12 @@
|
|||
Introduced the EMMA code coverage tool. A report is produced
|
||||
as a result of running the unit tests.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Retired the usage checks to the contrib directory. If there is
|
||||
interest in the future they may be promoted back into the
|
||||
optional set of checks.
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue