The intelliJ generated the @moduledoc false but I dont know what does it mean and useful ?
Unfortunately, that page in the getting started guide does not contain information on @moduledoc false
(or @doc false
). It does link to another page inside Elixir’s documentation, which does have information on this: writing documentation – hiding internal modules and functions.
To summarize:
Usually, @doc
and @moduledoc
receive a string, which is the documentation that will be used.
When typing @doc false
, you indicate that this function should not be documented. This is usually the case if it is a public function that is not part of the public API.
@moduledoc false
indicates that you have no intention of documenting any functions in this module, and that the whole module should be hidden from the documentation.
That IntelliJ’s auto-generated module includes this attribute is something that I find a little worrying; @moduledoc false
is something to only be used in special cases where the current module is for internal use only. The default should be to give everything a little bit of documentation. @moduledoc ""
would therefore be a more sensible default, in my opinion.
Yeah, I figured out it’s pretty obvious what false
does once you read the page above. It’s like :nodoc:
in Ruby for example.
My atom plugin set currently does not put a moduledoc
, which then causes credo to yell at me for not having one. I prefer this method as it is more noisy, I.E. more likely to make me document. ^.^