Credence.Rule.NoKernelShadowing (credence v0.3.1)

Copy Markdown

Idiomatic rule: warns when variables shadow Kernel functions.

Using max or min as variable names (e.g., in Enum.reduce or function arguments) shadows the built-in Kernel functions.

While max(max, value) is valid Elixir, it is considered unidiomatic and can lead to confusion or subtle bugs.

Prefer:

  • max_val, global_max, or limit instead of max
  • min_val, local_min, or bottom instead of min