Rules to check and implement: ## General - [x] no nested functions - [x] no nested classes (`Meta` as whitelist) - [ ] no unused arguments - [ ] no `len(x) == 0` in `if` conditions - [ ] no always `True` checks - [x] no `raise` (without new exception) not within `except` - [x] no `raise NotImplemented` - [x] no `__author__` - [ ] no `/` linebrakes ### Complexity - [x] too many local variables - [x] too many arguments - [ ] too many branches - [x] too many `return`s - [x] too many expressions - [ ] too many statements - [ ] too deep nesting ### Function calls - [x] no `exec`, `eval`, and `compile` - [x] no `vars()`, no `dir()` - [x] no `print`, `pprint` - [x] no `input` - [x] no `globals()`, no `locals()` - [x] no short function names ### Keywords - [x] no `global`, no `nonlocal`, no `del`, no `pass` ## Imports - [x] no `from some import *` aka star-import - [x] no `from .. import some` aka dot import - [x] no nested imports - [x] no `__import__` ## Classes - [ ] no `return`/`yield` in `__init__` - [ ] no `self` override - [ ] `self` is not used - [x] first method argument must be `cls` or `self` if not `staticmethod` - [ ] too few public method (`__init__` + one other) - [ ] too many public methods - [ ] too many instance attributes - [x] no magic methods: `__del__` - [ ] no attributes with default `None`: `class Fixture: some_attribute = None` ## Variables - [x] no blacklist variable names: `data`, `result` - [x] no short variable names ## Files - [ ] no bom - [ ] no long files, `max-file-lines = 600` - [ ] no logic in `__init__.py` - [ ] no `__{}__` filenames, except `__init__` and `__main__` ## mypy - [ ] follow this pattern: `x: List[SomeValue] = []`, `def cast(element: Element = None) -> str:`
Rules to check and implement:
General
Metaas whitelist)len(x) == 0inifconditionsTruechecksraise(without new exception) not withinexceptraise NotImplemented__author__/linebrakesComplexity
returnsFunction calls
exec,eval, andcompilevars(), nodir()print,pprintinputglobals(), nolocals()Keywords
global, nononlocal, nodel, nopassImports
from some import *aka star-importfrom .. import someaka dot import__import__Classes
return/yieldin__init__selfoverrideselfis not usedclsorselfif notstaticmethod__init__+ one other)__del__None:class Fixture: some_attribute = NoneVariables
data,resultFiles
max-file-lines = 600__init__.py__{}__filenames, except__init__and__main__mypy
x: List[SomeValue] = [],def cast(element: Element = None) -> str: