forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#11446: update TreeWalkerTest to use verifyInlineConf…
…igParser
- Loading branch information
Showing
7 changed files
with
78 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/test/resources/com/puppycrawl/tools/checkstyle/treewalker/InputTreeWalker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.treewalker; | ||
/*comment*/ | ||
public class InputTreeWalker { | ||
} | ||
//violation below,'Top-level class InputTreeWalkerInner has to reside in its own source file' | ||
class InputTreeWalkerInner { | ||
} |
6 changes: 5 additions & 1 deletion
6
src/test/resources/com/puppycrawl/tools/checkstyle/treewalker/InputTreeWalkerJavadoc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.treewalker; | ||
|
||
/** <p>Javadoc comment. */ // violation | ||
/** <p>Javadoc comment. */ // violation, 'Redundant <p> tag' | ||
public class InputTreeWalkerJavadoc { | ||
} |
10 changes: 9 additions & 1 deletion
10
.../resources/com/puppycrawl/tools/checkstyle/treewalker/InputTreeWalkerMultiCheckOrder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck | ||
com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.treewalker; | ||
|
||
public class InputTreeWalkerMultiCheckOrder { | ||
public void method() { | ||
boolean test = true; | ||
if(test) { | ||
if(test) { // 2 violations | ||
|
||
} | ||
} | ||
} |
14 changes: 12 additions & 2 deletions
14
...resources/com/puppycrawl/tools/checkstyle/treewalker/InputTreeWalkerMultiCheckOrder2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck | ||
format = ^[a-z]([a-z0-9][a-zA-Z0-9]*)?$ | ||
accessModifiers = protected, package, private | ||
com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck | ||
format = ^[a-z][a-z0-9][a-zA-Z0-9]*$ | ||
accessModifiers = public | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.treewalker; | ||
|
||
public class InputTreeWalkerMultiCheckOrder2 { | ||
void fn1(int v1) {} | ||
protected void fn2(int V2) {} // violation "Parameter name 'V2' must match pattern" | ||
protected void fn2(int V2) {} // violation "Name 'V2' must match pattern" | ||
private void fn3(int a) {} | ||
public void fn4(int b) {} // violation "Parameter name 'b' must match pattern" | ||
public void fn4(int b) {} // violation "Name 'b' must match pattern" | ||
} |
12 changes: 12 additions & 0 deletions
12
...ources/com/puppycrawl/tools/checkstyle/treewalker/InputTreeWalkerProperFileExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.treewalker; | ||
|
||
public class InputTreeWalkerProperFileExtension { | ||
|
||
public static final int k = 5 + 4; | ||
// violation above, "Name 'k' must match pattern" | ||
} |
12 changes: 10 additions & 2 deletions
12
...s/com/puppycrawl/tools/checkstyle/treewalker/InputTreeWalkerSuppressionCommentFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck | ||
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilter | ||
checkCPP = false | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.treewalker; | ||
|
||
public class InputTreeWalkerSuppressionCommentFilter { | ||
private int I; | ||
private int I; //violation, "Name 'I' must match pattern" | ||
/* CHECKSTYLE:OFF */ | ||
private int J; | ||
/* CHECKSTYLE:ON */ | ||
//CHECKSTYLE:OFF | ||
private int P; | ||
private int P; //violation, "Name 'P' must match pattern" | ||
//CHECKSTYLE:ON | ||
} |