wemake-python-styleguide icon indicating copy to clipboard operation
wemake-python-styleguide copied to clipboard

Allow custom short names

Open rusmux opened this issue 2 years ago • 3 comments

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 avatar Dec 09 '22 12:12 rusmux

+1 same to df (pandas data frame)

whysage avatar Dec 09 '22 13:12 whysage

I would like to work on this issue

adlizone avatar Feb 16 '23 18:02 adlizone

+1

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

This is very common and yet gets flagged.

Day0Dreamer avatar Mar 31 '24 00:03 Day0Dreamer