-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Issue #6207: Add xpath regression test for UnusedImports #6975
Issue #6207: Add xpath regression test for UnusedImports #6975
Conversation
src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java
Outdated
Show resolved
Hide resolved
src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java
Outdated
Show resolved
Hide resolved
8b57a21
to
fc00575
Compare
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 to merge.
We appreciate your help.
@pbludov , please finalize review
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.
I'm OK to merge.
}; | ||
|
||
final List<String> expectedXpathQueries = Collections.singletonList( | ||
"/IMPORT/DOT[./IDENT[@text='List']]/DOT/IDENT[@text='java']"); |
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.
This will suppress any import that matches import java.*.List
, i.e.
import java.otherpackage.List;
I'm not sure they ever exist, so it's OK. However, the bad thing is that users can use this xpath as an example.
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.
@pbludov I believe this regression should be checking the output from the CLI when verifying the xpath. If you feel it is being too loose, then please make an issue on it.
checkstyle/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java
Line 67 in b5ab579
private static List<String> generateXpathQueries(File fileToProcess, |
This PR adds XPath regression test for suppression filter on UnusedImports check, see #6207.