Skip to content

Code quality checks#

Running single test file

To run single test file with pytest

pytest tests/test_folder/test_feature.py -rP
You can select single test too
pytest tests/test_folder/test_feature.py -rP -k test_name

flake8#

Flake8 is a wrapper around these tools:

See list of awesome flake8 plugins

List of included 3rd-party plugins:


pre-commit#

A framework for managing and maintaining multi-language pre-commit hooks.

Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks.

List of hooks#

  • flake8

    - flake8-alfred
    - flake8-alphabetize
    - flake8-broken-line
    - flake8-bugbear
    - flake8-builtins
    - flake8-comprehensions
    - flake8-docstrings
    - flake8-eradicate
    - flake8-functions
    - flake8-functions-names
    - flake8-printf-formatting
    - flake8-pytest-style
    - flake8-simplify
    - pep8-naming
    - flake8-cognitive-complexity
    - flake8-expression-complexity
    
  • pre-commit-hooks

    1
    2
    3
    4
    5
    6
    7
    -   trailing-whitespace
    -   end-of-file-fixer
    -   debug-statements
    -   check-added-large-file
    -   no-commit-to-branch
    -   requirements-txt-fixer
    -   trailing-whitespace
    

Last update: July 3, 2022
Created: July 3, 2022