Automatically check all Python files in a project for PEP 8 style violations and undefined variable errors before committing.
Set up a Git pre-commit hook to block commits that introduce new linting errors.
Add a community plugin for import ordering or security pattern detection on top of the default checks.
Suppress specific warning codes on individual lines without disabling checks for the whole file.
Flake8 is a command-line tool for Python developers that checks code for style problems and common bugs. Rather than building all the checking logic itself, it wraps three existing tools: PyFlakes (which catches likely bugs like undefined names), pycodestyle (which checks that code follows the PEP 8 style guide, Python's standard formatting conventions), and McCabe (which measures how complex a function is). Running the single flake8 command triggers all three and shows their combined output grouped by file. The tool gives developers a few ways to suppress warnings they want to ignore. Adding a comment called flake8: noqa anywhere in a file tells flake8 to skip that file entirely. Adding noqa at the end of a specific line suppresses all warnings for that line. You can also name specific error codes to silence only particular checks while still catching others on the same line. Flake8 integrates with version-control systems through Git and Mercurial hooks, so you can run checks automatically before each commit. It also has a plugin system through Python package entry points, which lets third parties extend what it checks for. A wide ecosystem of community plugins exists for things like import ordering, docstring style, and security patterns. The project is part of PyCQA, a collection of Python code-quality tools maintained by the Python community. It has an FAQ and full documentation at its own website. Questions can be sent to a mailing list at code-quality@python.org, and a Discord server is available for community discussion. The README is brief and points to external documentation for installation and setup instructions.
← pycqa on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.