-
-
Notifications
You must be signed in to change notification settings - Fork 421
Add Exceptions for TooShortNameViolation #1539
Copy link
Copy link
Closed
Labels
featureNew feature or requestNew feature or requestgood first issueEntrypoint to the projectEntrypoint to the projecthelp wantedExtra attention is neededExtra attention is neededpr-mergedrule requestAdding a new ruleAdding a new rule
Milestone
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requestgood first issueEntrypoint to the projectEntrypoint to the projecthelp wantedExtra attention is neededExtra attention is neededpr-mergedrule requestAdding a new ruleAdding a new rule
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 npThesis
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.