christopheradams / elixir_style_guide

A community driven style guide for Elixir
4.37k stars 299 forks source link

@module_attribute should be moved higher in Module attribute ordering #170

Closed anthonator closed 5 years ago

anthonator commented 6 years ago

I would expect @module_attribute would come after @moduledoc and @behaviour. The reason being they can be compiled into other attributes in the list.

For instance, this is possible:

defmodule MyModule do
  @attrs [ :attr_1 ]

  defstruct @attrs
end
christopheradams commented 5 years ago

I agree that module attributes could generally come earlier in the module ordering.

Here's an example from the standard library: https://github.com/elixir-lang/elixir/blob/v1.7.4/lib/elixir/lib/hash_dict.ex#L21