Setup

Remember that wemake-python-styleguide is just a flake8 plugin.

Installation

pip install wemake-python-styleguide

We also recommend to use poetry instead of a default pip.

You might want to also install optional tools that pairs nicely with wemake-python-styleguide:

  • ondivi for easy integration into a legacy codebase

  • nitpick for sharing and validating configuration across multiple projects

Running

To run our linter you will need to run flake8 in any way you like:

flake8 .  # runs on all python files in the current directory (recommended)
flake8 your_module.py  # runs on a single file
flake8 your_package  # runs on a single your_package

See the flake8 docs for options and usage examples.

Golden rule is to run your linter on each commit locally and inside the CI. And to fail the build if there are any style violations.

Check out how we do it in our different templates:

Further reading