simona
simona copied to clipboard
Automate imports sorting
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
- format and sort imports via gradle command
- 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.