Skip to content

Add Exceptions for TooShortNameViolation #1539

@webartifex

Description

@webartifex

Rule request

I tend to set min-name-length to 2 in my projects [default is 3]

Then, I get a WPS111 error, for example, for import numpy as np

Thesis

I feel it would be great if there were an allowlist for names that are too short given the configuration but still allowed.

Reasoning

No matter if min-name-length is 2 or 3, there will always be common idiomatic names that are short.

Examples: np (numpy), df (common name when working with only one Pandas DataFrame), sns (Seaborn), sa (sqlalchemy), ...

Alternative: Provide a default allowlist with common short names that do not cause an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions