ie3-institute / simona

simona is an agent-based discrete-event power system simulation model developed @ie3-institute
BSD 3-Clause "New" or "Revised" License
26 stars 4 forks source link

Automate imports sorting #661

Open sebastian-peter opened 9 months ago

sebastian-peter commented 9 months ago

It is quite annoying that imports have to be sorted "manually", since different import orders can be committed and make merge conflicts more likely.

Luckily, there are tools that can

  1. format and sort imports via gradle command
  2. check for correctly formatted imports and fail CI otherwise

Scalafix with the OrganizeImports rule is one of those tools. There are further rules like DisableSyntax that could be helpful for keeping the code clean. There is a gradle plugin for scalafix.

Before integrating Scalafix into the project, research other tools that offer similar functionality - there might be some that are better suited for us.

sebastian-peter commented 9 months ago

Tried scalafix, which takes very long for formatting and checking, among other issues. Would need some more work, if we want to include it at all.