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

Allow custom short names #2554

Closed
rusmux opened this issue Dec 9, 2022 · 4 comments
Closed

Allow custom short names #2554

rusmux opened this issue Dec 9, 2022 · 4 comments
Labels
rule request Adding a new rule

Comments

@rusmux
Copy link

rusmux commented Dec 9, 2022

Rule request

While some short names have been whitelisted in #1548, there are still cases when using short names is justified. For example, albumenatations library uses A as an alias in their examples. Or x and y are common names in machine learning. Disabling the entire WPS111 rule would be too broad, while putting noqa would pollute the code. There is an option to add allowed domain names (#1106), but this does not exclude them from the WPS111 rule.

Thesis

Make adding variable names to allowed domain names exclude them from the WPS111 rule.

Reasoning

There are still short names that are justified to be used in some domains. Like x and y in machine learning or A as an alias for the albumentations library.

@rusmux rusmux added the rule request Adding a new rule label Dec 9, 2022
@whysage
Copy link
Contributor

whysage commented Dec 9, 2022

+1
same to df (pandas data frame)

@adlizone
Copy link

I would like to work on this issue

@Day0Dreamer
Copy link

+1

    except ResourceTimeout as e:
        logger.error(f"{e}")

This is very common and yet gets flagged.

@sobolevn
Copy link
Member

Will be included in 1.0.0 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule request Adding a new rule
Projects
None yet
Development

No branches or pull requests

5 participants