Skip to content

Linting and formatting

In Lime projects we are also using linting tools to catch common code mistakes and follow a shared set of formatting rules. For Python we are using flake8 and for Web Components we are using ESLint.

Info

Our standard CI toolchain will fail any build containing any lint error.

flake8

To lint you Python code with flake8 use:

poetry run flake8 .

VS Code can be configured to automatically lint your code.

black

We also recommend formatting the code with black, which will format your code according to a set of formatting rules.

If you have black installed you can either use it to check your code for inconsistencies with regards to the formatting rules, or run the automatic formatting.

Checking your code:

poetry run black . --check

Formatting your code:

poetry run black .

isort

Another recommended formatting tool is isort, which will sort and format the import statements in your python files.

If you have isort installed it can also be used to check your code or run automatic formatting.

Checking your code:

poetry run isort . --check

Formatting your code:

poetry run isort .