-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add IntelliJ formatter #846
Conversation
Signed-off-by: Peter Nied <[email protected]>
@@ -0,0 +1,77 @@ | |||
<code_scheme name="OpenSearch" version="173"> |
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.
Do we want to add this in a .idea to pre-configure it?
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 don't know how to do that, but that sounds like a great follow up PR - want to take that on?
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.
Thanks for doing this... one question on the import ordering that seems overly prescriptive.
<package name="io.opentelemetry" withSubpackages="true" static="false" /> | ||
<package name="com.google" withSubpackages="true" static="false" /> | ||
<package name="com.fasterxml" withSubpackages="true" static="false" /> | ||
<package name="org.apache" withSubpackages="true" static="false" /> | ||
<package name="org.hamcrest" withSubpackages="true" static="false" /> | ||
<package name="org.junit" withSubpackages="true" static="false" /> |
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.
Why are these called out separately? Why are there two places that I have to check for 3rd party imports? I can understand keeping migrations/opensearch things in one block and java stuff in another. Beyond that, it seems like everything is on equal standing.
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.
This list is derived from the existing spotless rules, lets handle that out of band of this change. For intellij-formatter.xml
was generated by exporting the settings from IntelliJ rather than edited by hand.
@gregschohn What would you like to do with this PR. I do not have much in investing more into this change, just want to get something out there to unblock folks. I think it would be useful to merge as is and folks such as yourself could refine the formatter settings. If you don't think so I'd rather close this out. What do you think? |
I just ran spotless on an RFS directory and got this back...
The fact that we're currently splitting our own implementations into two groups (notice that com.rfs is still the package namespace for lots of RFS code). Furthermore, the reactor imports are separate from hamcrest and otel, which doesn't make sense to me. With this change, we'll have 3 versions of files that we need to fix up going forward. I'd rather find out what rules we want & push them all out in a unified format, otherwise, the tax of tweaks is tripled. |
@gregschohn I'm going to close out this PR - it doesn't seem to be helping and I don't plan on spending more cycles here. Feel free to pick it up or make another PR for that changes you'd like to see. |
Description
Adds an IntelliJ native formatter based off the eclipse formatter that also supports import ordering.
Testing
Manually verified the
Optimize Imports
output does not alter existing files on all classes underDocumentsFromSnapshotMigration/src/test/java/com/rfs/
Check List
New functionality includes testingAll tests pass, including unit test, integration test and doctestBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.