Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Exceptions for TooShortNameViolation #1539

Closed
webartifex opened this issue Aug 5, 2020 · 0 comments · Fixed by #1548
Closed

Add Exceptions for TooShortNameViolation #1539

webartifex opened this issue Aug 5, 2020 · 0 comments · Fixed by #1548
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

Comments

@webartifex
Copy link

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.

@webartifex webartifex added the rule request Adding a new rule label Aug 5, 2020
@sobolevn sobolevn added feature New feature or request good first issue Entrypoint to the project help wanted Extra attention is needed labels Aug 5, 2020
@sobolevn sobolevn added this to the Version 0.15 aka New runtime milestone Aug 5, 2020
deveshsangwan added a commit to deveshsangwan/wemake-python-styleguide that referenced this issue Aug 12, 2020
deveshsangwan added a commit to deveshsangwan/wemake-python-styleguide that referenced this issue Aug 12, 2020
@deveshsangwan deveshsangwan mentioned this issue Aug 12, 2020
4 tasks
@helpr helpr bot added the pr-available label Aug 12, 2020
deveshsangwan added a commit to deveshsangwan/wemake-python-styleguide that referenced this issue Aug 12, 2020
deveshsangwan added a commit to deveshsangwan/wemake-python-styleguide that referenced this issue Aug 12, 2020
deveshsangwan added a commit to deveshsangwan/wemake-python-styleguide that referenced this issue Aug 12, 2020
sobolevn pushed a commit that referenced this issue Aug 13, 2020
* added allowlist for commonly used aliases/shortforms (#1539)

* added allowlist for commonly used aliases/shortforms (#1539)

* added allowlist for commonly used aliases/shortforms (#1539)

* added allowlist for commonly used aliases/shortforms (#1539)

* added allowlist for commonly used aliases/shortforms (#1539)
@helpr helpr bot added pr-merged and removed pr-available labels Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants