A Python linter that checks style and common errors by combining pycodestyle, pyflakes and McCabe
open sourceMITfree
Flake8 is an open source Python linter from the PyCQA that wraps pyflakes (logical errors such as unused imports and undefined names), pycodestyle (PEP 8 style) and the McCabe complexity checker behind one command and one configuration, with a plugin system that many third-party checks build on. Microsoft's Flake8 extension runs it inside VS Code.
Problems it solves
- check my Python code for PEP 8 style problems and unused imports in CI
- catch undefined names and other simple errors in Python before running it
- enforce one Python style across the team with a lint step
Features
- pyflakes, pycodestyle and McCabe checks in one tool
- Plugin system for extra checks
- Per-file and per-line ignores
- VS Code extension
Alternatives
The same job
These do what Flake8 does.
- Pylint A thorough static code analyser for Python that infers values instead of trusting type hints
- Ruff An extremely fast Python linter and code formatter, written in Rust
- Credo Static code analysis for Elixir, with a focus on teaching and code consistency
- ansible-lint Checks playbooks for practices and behavior that could potentially be improved
