Setup¶
Remember that wemake-python-styleguide is just a flake8 plugin.
That is compatible with ruff --select=ALL and should be used after it.
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
Required configuration¶
You must either provide --select=WPS to all your flake8 calls,
or add select = WPS into your flake8 configuration file.
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:
djangoandgitlab-ci: https://github.com/wemake-services/wemake-django-templatepythonpackage andtravis: https://github.com/wemake-services/wemake-python-package
Further reading