v1.10.1: experimental refactoring tasks
Adds two experimental refactoring features as mix tasks.
mix styler.remove_unused
With Elixir 1.20 on the horizon, many projects are about to discover that they have a lot of unnecessary require Logger lines throughout their codebase.
mix styler.remove_unused will automate the removal of those unused require: statements, alongside any unused import: and unused alias: warnings.
This has long been an internal script useful for running after a bigger refactor that resulted in many superfluous aliases, but with 1.20 coming it seems it might be useful for others as well.
This will never be an integrated part of Styler's format plugin features, as it would not be correct to remove unused nodes whenever running format. It's typical to have unused warnings while in the midst of an implementation, and deleting that code would be obnoxious.
mix styler.inline_attrs <file>
Inlines one-off module attributes that define literal values.
This is something that sometimes is good, and sometimes is bad. In general, defining a module attribute when you could've just written an atom is bad, so inlining is good!