Flake8

Flake8

flake8.pycqa.org

1

About this website

Flake8 is a popular Python linting tool that serves as a wrapper combining three other tools: PyFlakes for detecting logical errors (undefined names, unused imports, redefined functions), pycodestyle (formerly pep8) for checking PEP 8 style compliance (line length, indentation, whitespace, blank lines), and the McCabe complexity plugin for calculating cyclomatic complexity of Python functions. Created by Tarek Ziade in 2010 and maintained by the Python Code Quality Authority (PyCQA), Flake8 has become the most widely adopted Python linter with millions of weekly pip downloads and adoption by major open-source projects including Django, Requests, Flask, and the Python standard library development workflow. The tool runs all three checkers in a single pass over the source code, producing a unified output of warnings and errors with file names, line numbers, column positions, and error codes prefixed by category: E and W for pycodestyle errors and warnings (E1xx for indentation, E2xx for whitespace, E3xx for blank lines, E5xx for line length), F for PyFlakes errors (F401 for unused imports, F811 for redefined names, F821 for undefined names), and C for McCabe complexity violations (C901 for functions exceeding complexity threshold). Flake8 is highly configurable through command-line arguments, setup.cfg, tox.ini, or .flake8 configuration files, supporting per-file ignores, select/deselect rules by error code, maximum line length customization, complexity threshold setting, and extendable via third-party plugins installed via pip (flake8-bugbear, flake8-comprehensions, flake8-docstrings, flake8-import-order, and many more). The tool integrates seamlessly with pre-commit hooks, IDEs (VS Code, PyCharm, Vim, Sublime Text), and CI/CD pipelines.

Tags & Categories

Categories

Tags

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!