Linters

This projects uses several linters to make coding style consistent.

Project linters

All configuration is stored inside setup.cfg.

flake8

flake8 is used a general tool for linting. It includes several plugins, which could be found in Pipfile.

isort

We also use isort to check import order.

Running project linters

Run pytest. It will run style checks as well.

Additional linters

We use several additional linters that are not integrated into the pytest pipeline.

pylint

We also use pylint at CI step. But it is not a mandatory tool. Violation of any pylint rules do not break the build.

You may be wondering why are we using pylint in such strange manner? Well, there are two reasons:

  1. pylint is really good
  2. pylint is very strict. And it is not usable with tools like django

pylint fails on different django magic like .objects, but reports generated by pylint are very useful.

See docker/ci.sh for more details.

Linters that are not included

Sometimes we use several other linters that are not included. That’s because they require another technology stack to be installed or just out of scope.

Here’s the list of these linters.

shellcheck

This linter is used to lint your .sh files. See shellcheck docs.

hadolint

This linter is used to lint your Dockerfile (not very useful). See hadolint

yamllint

This linter is used to lint your yaml files. Run yamllint .. See yamllint docs.