CredoDeprecate.Checks.DeprecateFunctionOrMacro (credo_deprecate v0.1.10)
View SourceBasics
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
Prevents new usage of deprecated functions and macros while allowing existing usage via an allow_list
which you can't do with the built in @deprecated attribute.
The check detects all forms of function and macro calls: direct calls, aliased calls, imported calls, required calls.
Check-Specific Parameters
Use the following parameters to configure this check:
:mfa
A tuple {Module, :function_or_macro, arity} specifying the deprecated function or macro.
This parameter defaults to nil.
:allow_list
List of modules that are allowed to continue using the deprecated function or macro.
This parameter defaults to [].
:message
Custom error message to display when the deprecated function or macro is used.
This parameter defaults to nil.
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.