Skip to content

About flake8

As the website of flake8 mentions:

Quote

flake8 is a command-line utility for enforcing style consistency across Python projects.

How and why do we use flake8

flake8 is used in the CI/CD pipeline to ensure that the code quality is maintained and that the code is consistent across the project.

Install flake8

flake8 is a Python package, so it can be installed using pip:

pip install flake8

Configuration

You can configure flake8 by creating a .flake8 file in the root of your project. In the Swiss AI Center, we use the following configuration:

1
2
3
[flake8]
exclude = .git,__pycache__,venv,.venv
max-line-length = 120

Resources and alternatives

These resources and alternatives are related to the current item (in alphabetical order).

None at the moment.