Skip to content

no-generic-single-export-module

A generic module name should not conceal a single-definition responsibility.

Why

Names such as utils and helpers hide a module's responsibility and encourage unrelated additions.

Fix

Choose a responsibility-bearing module name or colocate the definition with its domain.

Examples

Before — flagged Generic module contains one public definition
utils.py
def snake_case_text(value: str) -> str: ...
After — preferred Specific module contains one public definition
text_case.py
def snake_case_text(value: str) -> str: ...

Formerly: single-public-export