elixir-styler
elixir-styler copied to clipboard
extract module attribute values to variables when moving them below references
this would fix the compilation-breakage that is detailed in the readme
# before
defmodule MyGreatLibrary do
@library_options [ ... ]
@moduledoc make_pretty_docs(@library_options)
use OptionsMagic, my_opts: @library_options
end
# after
library_options = [ ... ]
defmodule MyGreatLibrary do
@moduledoc make_pretty_docs(library_options)
use OptionsMagic, my_opts: unquote(library_options)
@library_options library_options
end
there'll likely be many edge cases to consider with this system, but i'm happy shipping it with just this test passing