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
Specify violation messages in input files #11214
Comments
I am on WhitespaceAfterCheck |
I am on EmptyBlockCheck |
|
@Kevin222004 Sure |
@Kevin222004 currently we have |
@Vyom-Yadav I am not able to find actual violation msg. Can you pls help me with it ? |
@Vyom-Yadav can I go through this documentation |
@SarveshLimaye It will be in the
Yes, you can read whatever you wish to. |
@Vyom-Yadav Thanks a lot! Can you confirm that this is the right .properties file |
Kindly make PR's so we can see better, every check has a violation message
The overlapping portion is present in both the check and the |
@Vyom-Yadav How to add violation message which contain more than one violation (ex :- // 2 violation and // 3 violation ) |
@Kevin222004 You don't have to specify a violation message where there are multiple |
@Vyom-Yadav |
The line shouldn't be longer than 100 characters. If your violation message is crossing 100 characters, eg-
you can change it to-
to reduce the line length. |
better to keep traling comment on same line as violation as message supports regexp and allow us to remove some obvious parts. |
@Kevin222004 It's your decision, you have to decide what to do based on some factors, first ask yourself if I shorten this message with the help of regex, will it make sense? secondly if not then try wrapping the violation part on the next line to fall within the limits, there is no set of rules, you have to decide what to do, in this particular case I would have wrapped the second argument on the next line to keep the violation message clearer. |
@Kevin222004 , you can shorten names parameters, change used types of parameter, you can do line wrap(but it will force you do more updates in test expectation due to line number shift.). |
@Vyom-Yadav @romani I am not able to solve this errors |
please send PR to let us see your problem and exact code (all details matter) that you have. |
Hi! I am on |
… UnnecessaryParenthesesCheck
In the class src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java it's unusual to find keyword An example -
The expected array comes out to be as -
|
…lizerPadCheck Input Files
…lizerPadCheck Input Files
…lizerPadCheck Input Files
Thanks a lot for raising this. It is bad design of our old tests. Ideally we should refactor such tests to remove violation comment from javadoc and put them above javadoc. |
To address this, shall we make a new issue or we can make the fix here only in the issue #11214 ? |
…lizerPadCheck Input Files
Please create new issue to update all javadoc Checks to avoid |
We have this issue now - #13969 |
…lizerPadCheck Input Files
…lizerPadCheck Input Files
Some of the input files using the class - FinalClassCheckTest doesn't have violation message specified in them and yet this check is not in the suppression list and evidently not causing any errors as well. What could be the reason for this? |
Not all |
…lizerPadCheck Input Files
I am on JavadocStyleCheck |
Thanks a lot to all the contributors involved! |
Single Check might have multiple violations messages, we need to see exact violation message if Check has multiple messages, to be sure that violation of correct type is placed at right line.
Violation messages have not been specified in certain input files, a list of checks in which violation message is not specified in the input file and have more than one violation message key has been specified here-
checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/bdd/InlineConfigParser.java
Line 99 in 72f1822
To Do-
// violation
commentSame has been demonstrated at 461cd04
If the violation message contains special regex characters, escape that character.
Ignore input files using more than a single check.
Ignore lines with multiple violations, eg-
and any other violation message of this nature.
List of Checks:
Old tracker (some might be outdated):
format it like:
checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/declarationorder/InputDeclarationOrderOnlyModifiers.java
Line 16 in 5b2a0ef
if message is long, we can shorten it by regexp usage (but do not over use regexp, message should be readable):
checkstyle/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/equalsavoidnull/InputEqualsAvoidNullEnhancedInstanceof.java
Line 15 in 4bd9856
There are a lot of examples in code just search for
// violation
in Input files for more examples.The text was updated successfully, but these errors were encountered: