simona icon indicating copy to clipboard operation
simona copied to clipboard

Automate imports sorting

Open sebastian-peter opened this issue 1 year ago • 1 comments

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 avatar Nov 22 '23 22:11 sebastian-peter