Add Exceptions for TooShortNameViolation #1539
Labels
feature
New feature or request
good first issue
Entrypoint to the project
help wanted
Extra attention is needed
pr-merged
rule request
Adding a new rule
Milestone
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.
The text was updated successfully, but these errors were encountered: