wemake-python-styleguide
wemake-python-styleguide copied to clipboard
Allow custom short names
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.
+1 same to df (pandas data frame)
I would like to work on this issue
+1
except ResourceTimeout as e:
logger.error(f"{e}")
This is very common and yet gets flagged.