Module unnecessary_function_arguments

A rule to detect unnecessary function arguments.

Behaviours: hank_rule.

Description

A rule to detect unnecessary function arguments.

The rule emits a warning for each function argument that is consistently ignored in all function clauses.

To avoid this warning, remove the unused argument(s).

Note: This rule will not emit a warning if the function implements a behaviour callback or a NIF call.

Function Index

ignored/2Rule ignore specifications example: -hank([{unnecessary_function_arguments, %% You can give a list of multiple specs or a single one [%% Will ignore any unused argument from ignore_me/2 within the module {ignore_me, 2}, %% Will ignore the 2nd argument from ignore_me_too/3 within the module {ignore_me_too, 3, 2}, %% Will ignore any unused argument from any ignore_me_again/x %% within the module (no matter the function arity) ignore_me_again]}]).

Function Details

ignored/2

ignored(Pattern::hank_rule:ignore_pattern(), FuncName::term()) -> boolean()

Rule ignore specifications example: -hank([{unnecessary_function_arguments, %% You can give a list of multiple specs or a single one [%% Will ignore any unused argument from ignore_me/2 within the module {ignore_me, 2}, %% Will ignore the 2nd argument from ignore_me_too/3 within the module {ignore_me_too, 3, 2}, %% Will ignore any unused argument from any ignore_me_again/x %% within the module (no matter the function arity) ignore_me_again]}]).


Generated by EDoc