Credo.Check.Warning.UnusedOperation (Credo v1.7.16)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of high and works with any version of Elixir.

Explanation

The result of a call to some functions has to be used.

This is a generic check that you can configure to your needs. With checks like UnusedEnumOperation you can catch instances where you call e.g. Enum.reject/1, but accidentally do not use the result:

def prepend_my_username(my_username, usernames) do
  Enum.reject(usernames, &is_nil/1)

  [my_username] ++ usernames
end

With this check you can do the same for your modules and functions.

Check-Specific Parameters

Use the following parameters to configure this check:

:modules

The modules and functions that should trigger this check.

        Format: `{module, list_of_function_names}` or `{module, list_of_function_names, issue_message}`

This parameter defaults to [].

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.