Skip to content
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

Spotless for imports #5741

Open
MartinWitt opened this issue Apr 6, 2024 · 2 comments
Open

Spotless for imports #5741

MartinWitt opened this issue Apr 6, 2024 · 2 comments

Comments

@MartinWitt
Copy link
Collaborator

MartinWitt commented Apr 6, 2024

Currently, our import ordering in spoon is a bit messy. This leads to an unpleasant time with IntelliJ trying to sort the imports in a more normal order. Why don't we use spotless-maven-plugin to sort all our imports in a fixed sorting? This also helps to reduce diffs in the future for PRs. The benefit compared to checkstyle is that we can do the sorting automatic. See https://github.com/diffplug/spotless/tree/main/plugin-maven#java for an example.

@MartinWitt
Copy link
Collaborator Author

We need to add

          <java>
            <importOrder />
          </java>

Any wishes for the order?
<order>java|javax,org,com,com.diffplug,,\#com.diffplug,\#</order>
<semanticSort>false</semanticSort>
<wildcardsLast>false</wildcardsLast>

@I-Al-Istannen
Copy link
Collaborator

I don't care as long as IJ can follow the same order and I don't need to run spotless :^)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants