KogenCredo.Check.Warning.StubBody (KogenCredo v0.1.0)
View SourceBasics
This check is disabled by default.
Learn how to enable it via .credo.exs.
This check has a base priority of low and works with any version of Elixir.
Explanation
A function that returns :not_implemented or raises "TODO" passes compilation and type
checks while doing nothing. Implement the behaviour now, or leave the function out so the
missing capability is a compile-time error rather than a runtime surprise.
Check-Specific Parameters
Use the following parameters to configure this check:
:included_paths
Only files under these path prefixes are checked.
This parameter defaults to ["lib/"].
:excluded_paths
Files under these path prefixes are skipped.
This parameter defaults to [].
:stub_atoms
Atoms that mark a placeholder return value.
This parameter defaults to [:not_implemented, :unimplemented, :not_yet_implemented].
:stub_exceptions
Exception modules that mark a placeholder raise.
This parameter defaults to [NotImplementedError, UnimplementedError].
:stub_pattern
Regex matched against raise/throw/exit messages.
This parameter defaults to ~r/\b(not (yet )?implemented|unimplemented|todo|stub(bed)?|placeholder|not supported yet)\b/i.
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.