-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supplemental: test cases added #12833
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
56 changes: 56 additions & 0 deletions
56
...rawl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolderAlias.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,56 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder | ||
aliasList = com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck=paramnum | ||
|
||
com.puppycrawl.tools.checkstyle.filters.SuppressWarningsFilter | ||
|
||
com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck | ||
max = (default)7 | ||
|
||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.suppresswarningsholder; | ||
|
||
public class InputSuppressWarningsHolderAlias { | ||
|
||
public void needsLotsOfParameters0(int a, // violation 'More than 7 parameters (found 8)' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
|
||
@SuppressWarnings("paramnum") | ||
public void needsLotsOfParameters(int a, // filtered violation 'max parameter' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
|
||
@SuppressWarnings("ParamnumUnknown") | ||
public void needsLotsOfParameters2(int a, // violation 'More than 7 parameters (found 8)' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
|
||
@SuppressWarnings("PAramnuM") | ||
public void needsLotsOfParameters3(int a, // filtered violation 'max parameter' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
|
||
@SuppressWarnings("PARAMNUM") | ||
public void needsLotsOfParameters4(int a, // filtered violation 'max parameter' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
|
||
@SuppressWarnings("paRAMnum") | ||
public void needsLotsOfParameters5(int a, // filtered violation 'max parameter' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
|
||
@SuppressWarnings("pAramNUm") | ||
public void needsLotsOfParameters6(int a, // filtered violation 'max parameter' | ||
int b, int c, int d, int e, int f, int g, int h) { | ||
// ... | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...awl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolderAlias2.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,35 @@ | ||
/* | ||
com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder | ||
aliasList = com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck=constant | ||
|
||
com.puppycrawl.tools.checkstyle.filters.SuppressWarningsFilter | ||
|
||
com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck | ||
format = (default)^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ | ||
|
||
|
||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.suppresswarningsholder; | ||
|
||
public class InputSuppressWarningsHolderAlias2 { | ||
private static final int a = 0; // violation 'Name 'a' must match pattern' | ||
|
||
@SuppressWarnings("Notconstant") | ||
private static final int b = 0; // violation 'Name 'b' must match pattern' | ||
|
||
@SuppressWarnings("CONSTANT") // filtered violation 'invalid pattern' | ||
private static final int c = 0; | ||
|
||
@SuppressWarnings("CONstant") // filtered violation 'invalid pattern' | ||
private static final int d = 0; | ||
|
||
@SuppressWarnings("consTant") // filtered violation 'invalid pattern' | ||
private static final int e = 0; | ||
|
||
@SuppressWarnings("cOnStAnT") // filtered violation 'invalid pattern' | ||
private static final int f = 0; | ||
|
||
@SuppressWarnings("cOnStAnT") // filtered violation 'invalid pattern' | ||
private static final int g = 0; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not same as
<property name="aliasList" value="ParameterNumber=paramnum" />
As you reference in issue.
You should have
aliasList=ParameterNumber=paramnum
Or second = to be escaped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we need both formats in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romani the issue #11641 is all about supporting the simple name
aliasList=ParameterNumber=paramnum
.Right now it only supports the fully qualified name #11542 (comment)
I will most probably send pr for fixing this by today #11641.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.