Repolode
PyCQA

PyCQA/flake8

A Python linter that wraps PyFlakes, pycodestyle and McCabe into one command, with support for third-party plugins.

Stars
3,833
Forks
364
Open issues
24
Last commit
3 days ago

What is it?

Flake8 checks Python source code for style violations and quality problems. It runs PyFlakes for logical errors such as unused imports, pycodestyle for PEP 8 style issues, and McCabe for code complexity, then merges all results into one per-file report from a single flake8 command.

Beyond combining these tools, Flake8 lets developers suppress warnings selectively. A file-level marker skips a whole file, a trailing noqa comment silences a line, and a noqa comment with specific error codes ignores only those errors. Git and Mercurial hooks are also supported.

Flake8 can be extended through the flake8.extension and flake8.formatting entry points, which allow third-party plugins to add checks and custom output formats.

Key features

  • 01Runs PyFlakes, pycodestyle and McCabe together from a single command.
  • 02Merges warnings into a per-file, unified output.
  • 03Supports file-level and line-level suppression with noqa comments.
  • 04Allows suppressing specific error codes on a line.
  • 05Provides Git and Mercurial hooks.
  • 06Extensible through third-party plugins via entry points.

Use cases

  • Enforcing PEP 8 style and catching common bugs in a Python project's CI pipeline.
  • Running lint checks as a Git hook before committing code.
  • Measuring and flagging overly complex functions with the McCabe checker.
  • Writing custom checks or output formats as a Flake8 plugin.

Quick start

  1. 1

    Follow the quickstart documentation linked in the README to install and run Flake8

Things to know

  • The license is not clearly identified in the project metadata.

In collections

Topics

FAQ

What is flake8?
A Python linter that wraps PyFlakes, pycodestyle and McCabe into one command, with support for third-party plugins. Flake8 checks Python source code for style violations and quality problems. It runs PyFlakes for logical errors such as unused imports, pycodestyle for PEP 8 style issues, and McCabe for code complexity, then merges all results into one per-file report from a single flake8 command.
Is flake8 free to use? What license does it have?
flake8 is open source under the Other license. Check the license terms before using it in commercial products.
Is flake8 still maintained?
Actively maintained. The last commit to flake8 was on Nov 4, 2026.
What can I use flake8 for?
Enforcing PEP 8 style and catching common bugs in a Python project's CI pipeline. Running lint checks as a Git hook before committing code. Measuring and flagging overly complex functions with the McCabe checker. Writing custom checks or output formats as a Flake8 plugin.
How do I install flake8?
Follow the quickstart documentation linked in the README to install and run Flake8
Where can I get flake8?
The source code and installation instructions are on GitHub: https://github.com/PyCQA/flake8

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects