INRIA / spoon

Spoon is a metaprogramming library to analyze and transform Java source code. :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.
http://spoon.gforge.inria.fr/
Other
1.74k stars 346 forks source link

Spotless for imports #5741

Open MartinWitt opened 5 months ago

MartinWitt commented 5 months ago

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 commented 4 months ago

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 commented 4 months ago

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

algomaster99 commented 1 day ago

Can we please add a good-first-issue label here? We can then ask new contributors to work on this :)

monperrus commented 18 hours ago

done