HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

flake8 — Check the style and quality of Python code. More information: <https://flake8.pycqa.org/en/latest/us

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandstyleandqualityclicheckflake8

Problem

How to use the flake8 command: Check the style and quality of Python code. More information: <https://flake8.pycqa.org/en/latest/user/options.html>.

Solution

flake8 — Check the style and quality of Python code. More information: <https://flake8.pycqa.org/en/latest/user/options.html>.

Lint a file or directory recursively:
flake8 {{path/to/file_or_directory}}


Lint a file or directory recursively and show the line on which each error occurred:
flake8 --show-source {{path/to/file_or_directory}}


Lint a file or directory recursively and ignore a list of rules. (All available rules can be found at <https://www.flake8rules.com/>):
flake8 --ignore {{rule1,rule2,...}} {{path/to/file_or_directory}}


Lint a file or directory recursively but exclude files matching the given globs or substrings:
flake8 --exclude {{substring1,glob2}} {{path/to/file_or_directory}}

Code Snippets

Lint a file or directory recursively

flake8 {{path/to/file_or_directory}}

Lint a file or directory recursively and show the line on which each error occurred

flake8 --show-source {{path/to/file_or_directory}}

Lint a file or directory recursively and ignore a list of rules. (All available rules can be found at <https://www.flake8rules.com/>)

flake8 --ignore {{rule1,rule2,...}} {{path/to/file_or_directory}}

Lint a file or directory recursively but exclude files matching the given globs or substrings

flake8 --exclude {{substring1,glob2}} {{path/to/file_or_directory}}

Context

tldr-pages: common/flake8

Revisions (0)

No revisions yet.