-
-
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 #3951: SeparatorWrap: add support for method reference operator #4149
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4149 +/- ##
======================================
Coverage 100% 100%
======================================
Files 283 283
Lines 14824 14824
Branches 3389 3389
======================================
Hits 14824 14824
Continue to review full report at Codecov.
|
@Luolc @Luolc
Should Google Style Guide be updated in the scope of this PR? |
Done. Please have a check whether the example is ok.
Done. New diff report is generated. Posted at same location: http://www.luolc.com/checkstyle-diff-report/issue3951/ |
@Luolc |
src/xdocs/config_whitespace.xml
Outdated
Example for method reference (good case and bad case): | ||
</p> | ||
<source> | ||
// violation, breaking after method reference is bad practice |
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.
Please, put the comment on the line where the violation is actually happens.
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.
Done.
@MEZk Oh... my fault. I only did rebase on my master branch. Sorry for that. |
@MEZk new report: http://www.luolc.com/checkstyle-diff-report/issue3951/ |
It means that diff.groovy does not take into account any excludes specified in projects-to-test-on.properties. It runs the report generation against all source files of the target projects. |
src/xdocs/config_whitespace.xml
Outdated
Example for method reference (good case and bad case): | ||
</p> | ||
<source> | ||
Arrays.sort(stringArray, String:: // violation, breaking after method reference is bad practice |
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.
It is not a general bad practice. User is able to decide whether he/she wants to configure the check to rise the violation if ::
is on the next line after line break. Please remove breaking after method reference is bad practice
.
Please, add an example of check's configuration for the given example as METHOD_REF is not in the set of default tokens.
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.
Done.
Styles are different from team to team, Check as ability to satisfy both of them by property
I did not find issue, looks like we miss it. @Luolc , please as you started to change ITs please do this in separate commit of this PR, please update google_checks.xml too. |
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.
@Luolc , please split this commit into two:
- Check udpate + checkstyle_checks.xml
- google style related udpates (ITs, config)
Unfortunately empty reports mean no regression, but it does not mean that Check works as expected.
additionally , please generate reports on projects that have "::" in mode eol
to see violations, lets validate violations.
…tion of SeparatorWrap
Done.
Done. New report with One of Travis-CI's job failed. Would you please restart it? https://travis-ci.org/checkstyle/checkstyle/jobs/220246004 Error log of the failed job:
|
restarted |
that is weird that with both options values there is no regression it could mean only that "::" is not used in this projects or there is not wraps ..... we need to see some violations on real code. Please run Check with both values against https://github.com/javaslang/javaslang , if you can find any other project that have wrapping of "::" it will be awesome. |
@romani @Luolc |
@romani Unfortunately there are still no regression. :( @rnveach I see wrapping of |
@Luolc Yes, this is why we added the red warning label to the diff reports to remind us we process all files in the project.
@Luolc How did you run regression with tokens
Please show us your full command line you used. |
@rnveach I found the error at first. To generate diff report, on my local master branch I add I am not using my working PC currently. The diff report generation script is on it. I will update the command I used once I get my PC tomorrow. |
@rnveach @romani Since it is a new token I could only use http://www.luolc.com/checkstyle-diff-report/reports/issue3951/nl/ These are the reports, we finally find BTW, how could I generate reports with root page like http://rveach.no-ip.org/checkstyle/regression/reports/17/ ? |
@Luolc My system is my own creation. It was made before the groovy scripts which try to copy most of my functionality with added support of non-Linux OSes. I will make a new issue to have groovy do regression with no base for new checks/tokens. |
In issue I did not found any, reference to google style, so issue was general and correct (violation was expected as config is required this) I am ok merge. @rnveach , please do final review and merge. |
#3951
Firstly, we need to confirm the check logic. As the issue mentioned:
want '::' operator at end of previous line
, but it is not correct according to google style: http://checkstyle.sourceforge.net/reports/google-java-style-20170228.html#s4.5.1-line-wrapping-where-to-breakNotice that the break should come before
::
.Configurations for Google style is updated as well.
Diff report is on the way.Diff report:
http://www.luolc.com/checkstyle-diff-report/issue3951/