Skip to main content

W0046 - Undocumented module

Weak Warning

-module(arith).
%% ^^^^ weak: The module is not documented.

Explanation

The current module is not documented and it should be documented via a -moduledoc attribute (preferred) or a (deprecated) %% @doc comment.

At the top of an Erlang module, it is good practice to add an overview of the module. The overview may include details on how to use the module API, some examples of the different functions working together or a diagram.

Documentation can be written in Markdown, and it is possible to include diagrams using the Mermaid syntax.

Documentation is usually made available in the form HTML pages generated by ExDoc. It is also used in the IDE in features such as hover, signature help and auto-complete.

If the module is part of an internal API, it is possible to silent the weak warning by adding the following:

-moduledoc false.

Example

-module(arith).
-moduledoc """
A module for basic arithmetic.

This module can be used to add and subtract values. For example:
""".
```erlang
1> arith:substract(arith:add(2, 3), 1).
4
```

See also

Erlang/OTP documentation