-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
-
-
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
Print name of the Check after printing violation message #2666
Comments
I vote for the last one. |
👍 for @rnveach proposition |
I agree with everything that was said, but would like to point out a few additional things:
Long story short:
|
maven-checkstyle-plugin do output like :
|
Originally I thought about update of only output that produce our CLI, not a serious update to format. xml format of Checkstyle already have all required information, not changes are required:
output format is:
Here is a clear that output format miss "source" information. Affected projects: eclipse-cs and other IDE plugins - eclipse-cs do not use DefaultLogger class at all and that is correct, other IDEs also should not use DefaultLogger for reporting. sonar-checkstyle - does not use DefaultLogger too. So we will not affect most critical plugins, if smb use DefaultLogger it will need to be updated. NO configation is required. We only need to decide on a format of output. |
There is one problem of format with "......message [CheckName]" is that any hacking/grep/sed/parsing of output will be complicated as message could contain "[" or "]". On the other side placing CheckName before message as PMD do distract user from meaningful message, in most cases user do not need to know how Check is named. My decision - I am ok with Attention: |
Sounds good to me! 👍 |
@MEZk , you can start implementation . |
@romani, I'm OK with your latest comments. However, I have one more proposition, similar to maven-checkstyle-plugin one:
Warning level is first, so it's consistent with logging frameworks. There is no strange double colon as in current format (~/Test1.java:5 |
I am fine with moving warning/error to the first position and in caps. |
Hey guys, from a sonarqube point of view, we will indeed probably have to parse the message to remove the check name, as it will be duplicated with the rule from the UI. The simpler you keep the format, the easier it will be for us to do it. Now, having the name at the end, as @rnveach proposes, is then maybe the best approach for us. From a feature point of view, I would also consider than then message associated to the error is somehow more important that the rule name itself. Thank you for the notification! I'll keep an eye on the discussion. |
Sorry for being late to the fray. This way I can still retain the option to toggle this on/off in eclipse-cs, and just need to realign the exact message format to the agreed upon "standard" |
I am fine with this also. But, now that I'm thinking about it, it may be helpful to include something in the message that identifies it as a Checkstyle message. Sometimes, people parse build log files to find relevant information, for example for integration purposes. This may not be the best approach, but in the real world, it happens. So we can make life easier by adding
|
We are not going to change message of violation, sorry for confusion. We will play with format of console logger only, Sonar does not use it. So Sonar is on save side.
Yes, no changes for AuditEvent class, we are going to have only change only in console output. I expect that nobody is using console to get violation.
This is the only case where I expect problems on client side, but we will NOT consider it, client has to change its parsing script.
It should be done by console plugins/extensions , we have only simple CLI (this is the main reason of this update) and it will be strange that tool prints its name before each line. I do not know any other tool that do this. |
I am ok with such moving severity to the front.
CheckName will looks good in front only when file path is short, and you have enough space to show message completely. Real example of violation:
So message will be too far from user attention. Check name is required only then it is not clear who do this violation with desire to reconfigure Check or review its config or get name to get documentation or report issue. In most cases users just follow Checkstyle recommendations. So format
will be read like: |
format for vote: I am +1. @m-g-sonar, @lkoe are not affected. @mkordas , you are the only left to make a final vote. Please do. |
@romani, +1 from me for your latest proposal |
@MEZk , you are ok to start implementation. |
right now we have format like:
it is not clear what Module/Check producing this, it is more actual to naming Checks where format of message is the same for several Check. User do not clearly see what Check config should be adjusted and what Check to search in web documentation , ..... .
PMD has format:
PMD Failure: com/puppycrawl/tools/checkstyle/api/JavadocTokenTypes.java:31 Rule:ExcessiveClassLength Priority:3 Avoid really long classes..
Findbugs format:
com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck$UniqueProperties doesn't override java.util.Hashtable.equals(Object) [com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck$UniqueProperties] At UniquePropertiesCheck.java:[line 1] EQ_DOESNT_OVERRIDE_EQUALS
should be like (one of) (I am in favour of first or second ):
The text was updated successfully, but these errors were encountered: