Constants¶
This module contains list of white- and black-listed python
members.
It contains lists of keywords and built-in functions we discourage to use. It also contains some exceptions that we allow to use in our codebase.
-
FUNCTIONS_BLACKLIST
= frozenset({'__import__', 'compile', 'copyright', 'credits', 'delattr', 'dir', 'eval', 'exec', 'exit', 'globals', 'hasattr', 'help', 'input', 'locals', 'quit', 'staticmethod', 'vars'})¶ List of functions we forbid to use.
-
MODULE_METADATA_VARIABLES_BLACKLIST
= frozenset({'__about__', '__all__', '__author__', '__version__'})¶ List of module metadata we forbid to use.
-
VARIABLE_NAMES_BLACKLIST
= frozenset({'bar', 'baz', 'content', 'contents', 'data', 'do', 'false', 'file', 'foo', 'handle', 'handler', 'info', 'item', 'items', 'no', 'obj', 'objects', 'objs', 'parameters', 'params', 'result', 'results', 'some', 'true', 'val', 'vals', 'value', 'values', 'var', 'variable', 'vars'})¶ List of variable names we forbid to use.
-
SPECIAL_ARGUMENT_NAMES_WHITELIST
= frozenset({'cls', 'mcs', 'self'})¶ List of special names that are used only as first argument in methods.
-
MAGIC_METHODS_BLACKLIST
= frozenset({'__del__', '__delattr__', '__delete__', '__delitem__', '__dir__'})¶ List of magic methods that are forbidden to use.
-
NESTED_CLASSES_WHITELIST
= frozenset({'Meta', 'Params'})¶ List of nested classes’ names we allow to use.
-
NESTED_FUNCTIONS_WHITELIST
= frozenset({'decorator', 'factory'})¶ List of nested functions’ names we allow to use.
-
FUTURE_IMPORTS_WHITELIST
= frozenset({'annotations', 'generator_stop'})¶ List of allowed
__future__
imports.
-
MODULE_NAMES_BLACKLIST
= frozenset({'helpers', 'util', 'utilities', 'utils'})¶ List of blacklisted module names.
-
MAGIC_MODULE_NAMES_WHITELIST
= frozenset({'__init__', '__main__'})¶ List of allowed module magic names.
-
MAGIC_MODULE_NAMES_BLACKLIST
= frozenset({'__dir__', '__getattr__'})¶ List of bad magic module functions.
-
MODULE_NAME_PATTERN
= re.compile('^_?_?[a-z][a-z\\d_]*[a-z\\d](__)?$')¶ Regex pattern to name modules.
-
MAGIC_NUMBERS_WHITELIST
= frozenset({0.5, 24, 60, 100, 1000, 1024})¶ Common numbers that are allowed to be used without being called “magic”.
-
MAX_NOQA_COMMENTS
= 10¶ Maximum amount of
noqa
comments per module.
-
MAX_NO_COVER_COMMENTS
= 5¶ Maximum amount of
pragma
no-cover comments per module.