-
Notifications
You must be signed in to change notification settings - Fork 461
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
Formatting stream API methods on multiple lines. #87
Comments
Hi @gaganis, welcome! As it turns out, I'm a committer for Spotless. The only formatter we support yet that formats streams similarly to how JUnit 5's maintainers do it is google-java-format. I believe @sormuras is looking into migrating JUnit 5 from the Eclipse formatter to google-java-format, but I can't seem to his branch ATM. I do wonder perhaps if the Eclipse formatter has a setting that allows streams and fluent constructs to be formatted like this. @nedtwigg, do you know of any such setting? If such a setting doesn't exist, I'd be happy to see this feature implemented. But as I know of no library which could do it, and neither do I know the technical details on formatting Java code, I've no idea where to start either. |
...deleted the proof-of-concept branch, as we don't want to touch the entire JUnit 5 code base just for re-formatting. May be later, if/when google/google-java-format#19 is fixed, I might reconsider putting that topic on the table, again. |
Well I was thinking more about using spotless for some of my own projects and I do prefer the one-per-line indented formatting. So I could get close to that formatting using spotless along with google-java-format? |
Yes, I think so @gaganis. |
|
Hello all!
Firstly I would like to let you know that I really liked your project! I have found it out by working on JUnit5 and I love spotlessApply! No more hassle over formatting :)
Thanks and kudos for the great work!
One of the things that I would have liked to be better would be if we could also automate formatting of the stream API differently from other methods. In JUnit5 currently the formatter:off and on directives are used to achieve the format manually.
This how it looks now manually:
Ideally it would be really cool to get this automatically with spotless but I imagine this could be pretty difficult to implement.
Has this been discussed before?
I am willing to help with this but currently have no idea where to start.
Thanks
Giorgos
The text was updated successfully, but these errors were encountered: