Linters

we should use several linters to make the coding style consistent. All configuration is stored inside setup.cfg

  • black

  • flake8 is used a general tool for linting

  • isort is used to validate import order

  • bandit for static security checks

Pre-Commit hooks

pre-commit-config.yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    - id: check-yaml
    - id: end-of-file-fixer
    - id: trailing-whitespace
  - repo: https://github.com/psf/black
    rev: 19.3b0
    hooks:
    - id: black

Flake8

flake8 plugins

MyPy

Mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing.

Installation and usage.

And run it.

Examples

Pre-Commit Hooks

Last updated

Was this helpful?