Flake8

flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

Installation

pip install flake8

Configuration

Minimal black compatible flake8 configuration.

[flake8]
max-line-length = 88
extend-ignore = E203

Integration with visual studio code

settings.json

{
    "python.linting.flake8Enabled": true,
    "python.linting.enabled": true,
    "python.linting.lintOnSave": true,
}

Whether to lint Python files using flake8

{
    "python.linting.flake8Enabled": true,
}

Whether to lint Python files.

{
    "python.linting.enabled": true,
}

Whether to lint Python files when saved.

{
    "python.linting.lintOnSave": true,
}

Integration with Git Hooks

To use Python, you need to install the pre-commit package.

repos:
  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.9.2
    hooks:
      - id: flake8