Credence.Pattern.NoDocFalseOnPrivate (credence v0.8.0)

Copy Markdown

Style rule: Detects any @doc annotation placed before private functions (defp).

Private functions cannot have documentation — the compiler ignores @doc on defp entirely. Adding @doc (whether false or a string) is redundant noise that misleads readers into thinking it's suppressing or providing docs.

Bad

@doc false
defp helper(x), do: x + 1

@doc "Helper that does X"
defp helper(x), do: x + 1

Good

defp helper(x), do: x + 1

# If you want to hide a public function from docs:
@doc false
def internal_api(x), do: x + 1