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
Add the new option for Checkstyle CLI to generate the basic suppression xpath #4530
Comments
We are not going to support GUI or will this be a different issue? If I use checkstyle in maven, how will I generate suppression(s) as I don't have standalone all jar (as it is not a maven depedency)? Should we not be concerned with maven and force them to come up their own thing in the next version?
Why do we need
What if my intention was to suppress the
Shouldn't it be |
@MEZk ,
expected output should be all tokens for "[2:4]"
we could think about approach like |
we will do GUI, but looks like CLI will be more convenient for first steps. I started to use CLI tree printing almost all the time. CLI is mostly for our convenience.
agree, no need.
agree.
agree, see my comment above.
@MEZk , please investigate and give us report, with all cases.
no changes in Checks are expected.
CLI should use all text fields if it smth valuable (not a literal, has the same content as token name, ....)
package node are siblings, I do not think we need them, we can do this after GSOC if that become required. |
Yes. We need to print all Xpath expressions. In general, we should avoid specifying of token type. User does not need to remember the token type if he wants to generate suppression xpath.
Yes, you are right.
Yes.
All xpath expressions should be printed for the specified column and line number. |
Please update issue description to specify all details, I will remove all our comments to keep issue clear |
@romani
and many more. The above mentioned report shows that there are many checks which logs only line number.
We need to pass TokenType through log method to LocalizedMessage. So it will be required to update all checks. |
true to say , it was done only because authors were lazy to put violation on certain token(name or ......).
Yes, confirmed. In this case you can report a column too. To make it requirement to report 3 elements (lineNo, colNo, tokenType). It might be reasonable for Check to pass to @MEZk , please investigate this, and confirm that it is reasoble. |
@romani @timurt @rnveach
|
@romani @rnveach |
Instead of duplicating this method, why don't we make an existing utility one |
Is is a good idea to invoke method from the class which name ends with *StringPrinter? |
Since that method isn't printing anything, should we just move it out to a different utility class? |
Yes, we can create a new utility class since now we have only TokenUtils class which is somehow connected with the tree. |
@MEZk ,
you can if you need, it is located in test only because it was required in test area only. What ever moving around utils methods is fine. |
Yes
It might be better to do it like:
@MEZk , please confirm that proposal. |
Yes, parentheses are not required. |
@timurt |
@timurt
|
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
…ate the basic suppression xpath
Fix was merged |
We need to add the new option for Checkstyle CLI to generate basic suppression xpath for the Checkstyle violations.
source file
AST
node which caused the violation
Possible example of usage:
Expected result
The text was updated successfully, but these errors were encountered: