Ben Chuanlong Du's Blog

It is never too late to learn.

Use Flake8 to Lint Python Scripts

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!


It is suggested that you put the configuration into a file named .flake8 in the root directory of your project. When flake8 supports pyproject.toml later, it is best to configure flake8 in pyproject.toml. Below is an example of configuration.

ignore = C901,E501,E251,E124,E125,E722,E261,E265,W291,W292,W293
exclude =,docs/source/,old,build,dist,.git,__pycache__
max-complexity = 10

Please refer to the following link for an example of configuration.