API Reference MikaCredoRules v#0.1.0

Copy Markdown View Source

Modules

Shared AST matching for module identity across every check.

Error tuples must carry a structured %ErrorMessage{}, not a bare string literal.

GenServer init/1 must defer real work to handle_continue/2.

Logger messages must start with "#{__MODULE__}: " and wrap every interpolated value in inspect/1.

Application environment must only be read or written from a config module.

A rescue clause must not catch every exception only to swallow it.

Mix.env() and Mix.target() must not be called from compiled code.

Mocking libraries must not be used — define a behaviour and inject the implementation instead.

Comparing against nil must use is_nil/1, not an equality operator.

Tests must not sleep — sleeping is the number one source of flaky, slow suites.

Helpers that already exist in a shared library must not be reimplemented locally.

Variables must not be named with a single letter.

Negated assertions must use refute, not assert ! or assert not.

Pure filename predicates shared by the scoping guards of every check.

Comparisons must use ===/!== instead of ==/!=.

Every todo comment must reference a ticket URL on the same or an adjacent line.