Hey Tim, thanks for the proposal.
As Wojtek mentioned, a strict goal of "mix format" is to never change the AST. This means that, in principle, we should not reorder statements.
In this particular case though, we have a much bigger issue: these statements might depend on each other. Take this snippet:
defmodule MyModule do
@some_mod GenServer
use @some_mod
end
You would not be able to reorder these statements without breaking things.
These kinds of checks belong in a linter, not a formatter, such as Credo (as you already mentioned). The fact that these changes are not applied automatically right now doesn't mean that they couldn't in the future 🙃. It might be useful for Credo to be able to apply some automatic fixes if it doesn't already have this ability.
Thanks for the proposal though!
Andrea