Issue #11939: New filter SuppressWithNearbyTextFilter#12151
Conversation
|
Github, generate site |
|
Site generation job failed on phase "parse_pr_info", step "React with rocket on run". |
|
@nrmancuso I think the failing check is not related to my changes, right? |
|
@stoyanK7 thanks for bringing this to my attention, inspections failure is not from your changes. I have changed some settings and restarted IDEA inspections. In the future, please put a link to failing build (and maybe snippet of output) in your comment, it will help us to easily help you from mobile. |
|
@romani ping |
|
Github, generate web site. |
|
Github, generate site |
|
@romani is it currently possible we get some traction on this? I am keen on finishing it :) |
|
Sorry for being slow... You in visible top of my to do list. |
|
@rnveach , please help to review this PR while I am focusing on yours |
rnveach
left a comment
There was a problem hiding this comment.
Also, Checker is failing the CI. Please make it so CI is green.
| </section> | ||
|
|
||
| <section name="SuppressWithNearbyTextFilter"> | ||
| <p>Since Checkstyle 10.3.4</p> |
There was a problem hiding this comment.
Since we had a release, this version and others in this PR needs to be updated.
There was a problem hiding this comment.
This needs to be updated again.
There was a problem hiding this comment.
Leaving this for the end.
| * <module name="Checker"> | ||
| * <module name="SuppressWithNearbyTextFilter"> | ||
| * <property name="checkPattern" value="LineLengthCheck"/> | ||
| * </module> |
There was a problem hiding this comment.
Can you show me this example in action through the CLI?
To me it looks like you must specify commentFormat as it still has SUPPRESS CHECKSTYLE, also I see other issues with this example.
Another question is, why are we using all Java examples for this? This check is built for other file types since it has no connection to the Java AST. I fine with 1 or 2 Java examples, but there should be more that are non Java and show the user how to configure them.
There was a problem hiding this comment.
I fine with 1 or 2 Java examples, but there should be more that are non Java and show the user how to configure them
Valid point, don't know what I was thinking when writing those examples. Will switch them up a bit. Probably with something from the tests but simplified.
There was a problem hiding this comment.
Now that you point it out, nearbyTextPattern needs to be set to .* for this to work. This example is completely messed up. It is the second line that should have violation, ugh. I will go trough them carefully now.
stoyan@ZenBook:~/Desktop/checkstyle$ cat config.xml <?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="SuppressWithNearbyTextFilter">
<property name="checkPattern" value="LineLengthCheck"/>
<property name="nearbyTextPattern" value=".*"/>
</module>
<module name="LineLength">
<property name="max" value="40"/>
</module>
<module name="TreeWalker">
<module name="ConstantName"/>
</module>
</module>stoyan@ZenBook:~/Desktop/checkstyle$ cat Test.java public final class Test {
static final int UPPER_CASE_CONSTANT1234567;
static final int lowerCaseConstant3;
static final int UPPER_CASE_CONSTANT4567891011;
}stoyan@ZenBook:~/Desktop/checkstyle$ java -jar /media/stoyan/Elements/Open\ Source/checkstyle/target/checkstyle-10.3.5-SNAPSHOT-all.jar -c config.xml Test.java
Starting audit...
[ERROR] /home/stoyan/Desktop/checkstyle/Test.java:3:18: Name 'lowerCaseConstant3' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]
Audit done.
Checkstyle ends with 1 errors.
There was a problem hiding this comment.
Done. Fixed examples and added SQL, XML ones.
I am not sure how to fix our CI execution.
Please suggest how to do this, it is filter. Both config and code should be updated to make it as diff. |
|
I recommend to create an issue to disable the ci item until after the work is merged if we will not create a fix before it is merged. We are not suppose to merge on a red ci. For regression, just run a no harm with the filter on a random check. Before is only the check, after is check and filter. Just looking for issues or exceptions. I recommend suppression text be something simple and common that people would use like"ignore this". |
|
We need to have shell version of code that bump second digit at Line 486 in bf9b7b2 |
|
@rnveach , check-since-version is fixed in separate commit of this PR. |
|
@stoyanK7 , I pushed in your branch, before working on it, please pull from stratch from remote. @rnveach , please continue review, we just need to know that code is ok and you need only report. |
|
My review is done until regression report is provided. |
|
Github, generate report |
|
@rnveach , report looks good |
|
@stoyanK7 CI is failing. Is pitest fix now going to be in this PR? |
|
@rnveach No, I will move it to a separate issue. Please proceed with the review. |
|
@stoyanK7 , please restore commit stoyanK7@eb46596 CI must be green to merge |
|
Github, generate site |
|
Site generation job failed on phase "generate_site", |
|
Github, generate site |
|
Github, generate site |
Resolves #11939
Diff Regression config: https://gist.githubusercontent.com/stoyanK7/c2a70dcd9dfc7ab1e689e54e3feba577/raw/ae91f59f217a8804d7d07cbbcfc7c8383108b490/config.xml
Diff Regression patch config: https://gist.githubusercontent.com/stoyanK7/934c2f859f7f9f97559bb339b3287deb/raw/edcc70b3257675a04e350f7ca8d614bd3c9cee06/config.xml