-
Notifications
You must be signed in to change notification settings - Fork 23
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
Improve formatting #156
base: master
Are you sure you want to change the base?
Improve formatting #156
Conversation
Signed-off-by: Arjan Tijms <[email protected]>
This change obviously can't be reviewed in this century, but I could re-apply your process and compare results. Can you share the details how it was done? |
Yes, add the Eclipse EE4J formatting file to the Eclipse IDE. Select all packages, choose source -> format. See https://github.com/eclipse-ee4j/ee4j/tree/master/codestyle Also, if you set the diff to ignore whitespace it becomes a lot easier to see (but obviously whitespace differences are an important factor of this PR) |
Any progress here? |
I've applied ee4j_intellij_formatting.xml with IDEA and got different result. Didn't investigate further. Either XMLs are out of sync, or there is no such thing as EE4J rules. |
What if we just say it improved formatting? It's much closer to the formatting of the other EE4J projects this way. |
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.
I agree it is not reviewable, but on the other hand all PRs after that will be - even if IDEA and Eclipse give different results, the difference is not so big (if I remember well).
Yet one thing - there is no such thing as "approved" EE4J rules, approved by all committers. However it can be still used as some rough recommendation - in the future it should be better based on checkstyle plugin, current Eclipse is able to configure it's formatting based on the maven checkstyle plugin config.
I let IDEA to modify everything in imported project. That was stupid and 3200 files were changed (including html, properties, etc.) arjantijms/orb@format...pzygielo:orb:ee4j-reformat-idea But even for java files only - there are differences for spacing, import order, indentations. I just haven't managed to run Eclipse with the referenced settings (yet). |
So I limited the changes to orbmain only (ee4j-reformat-idea-orbmain) and the results are of course much closer now: https://github.com/arjantijms/orb/compare/format..pzygielo:orb:ee4j-reformat-idea-orbmain. But this new diff is much more consumable over the single weekend I guess. |
I think it's better if there was some script that would do the formatting. Then everybody could run it and compare the results. FOr example, Google formatter (https://github.com/google/google-java-format) is a tool that can executed on command line, although I don't know if it's possible to configure it to match the Eclipse formatting. I don't like that formatting depends on an IDE. Then we get into debates which IDE is the one to use, because each IDE adds some of its formatting on top of the imported XML config for formatting. |
There is something to say for that indeed. Initially the IntelliJ and Eclipse files were really close, though not identical even then. Over time each of them added additional rules, with some defaults differing from the other. That said, even though it can be an exact science, it doesn't have to be. The basics of EE4J formatting is simply old Sun conventions, with 4 spaces for a tab, and a longer line width. |
Let's not overengineer it. It is the first and probably last large step. I would just check if there weren't for i loops transformed to foreach loops as it is usual trap breaking things which were invisibly already broken. Otherwise formatting should be safe. |
@pzygielo and others, is there some way to resolve this? The current formatting is horrible, this PR makes it much nicer. There is no perfection, but just a step in the right direction. |
@pzygielo just a ping. Any progress here? |
No description provided.