I want all of my exported functions to have type -spec
s, to ensure that there is at least basic documentation of the interface. Can I make the compiler or Dialyzer emit warnings for functions without type specifications?
There is an undocumented compiler (not Dialyzer) option called warn_missing_spec
that does this. On the command line, pass +warn_missing_spec
to erlc
:
erlc -o ebin +warn_missing_spec foo.erl
If you use Rebar, add warn_missing_spec
to erl_opts
:
{erl_opts, [warn_missing_spec]}.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With