Flake8 based linter with some qa best-practice for writing tests
pip inslall flake8-qa-style- CS001: using sleep(1) instead of sleep(var), var - meaningful variable
- CS002: using print()
- CS003: assert same variables: assert var == var
- CS004: assert variable with constant: assert var == 1
- CS005: missing type annotation for argument in function
- CS006: missing function return type annotation
- CS007: file should not start with a blank line
- CS008: nested "with" statements of the same type should be comma-separated
- CS009: each context manager in a "with" statement must be on its own line
- CS010: async function has no asynchronous calls or features
Rules configuration
[flake8]
;for methods with @property decorator skip CS006
skip_property_return_annotation = trueFlake8-qa-style is flake8 plugin, so the configuration is the same as flake8 configuration.
You can ignore rules via
- file
setup.cfg: parameterignore
[flake8]
ignore = CS001- comment in code
#noqa: CS001