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
try/rescue around a function that has a non-raising equivalent
is a sign the AI doesn't know Elixir's API.
# bad
try do
String.to_integer(value)
rescue
_ -> nil
end
# good
case Integer.parse(value) do
{int, ""} -> int
_ -> nil
endCommon pairs:
Check-Specific Parameters
There are no specific parameters for this check.
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.