CI
--
This guide shows how to use ``flake8`` inside your ``CI``.
travis
~~~~~~
Here's the minimal configuration required
to set up ``wemake-python-styleguide``, ``flake8``, ``travis`` up and running:
1. Learn how to `build python projects with travis `_
2. Copy this configuration into your ``.travis.yml``:
.. code:: yaml
dist: xenial
language: python
python: 3.7
install: pip install wemake-python-styleguide
script: flake8 .
You can also have some inspiration in our own `.travis.yml `_
configuration file.
Gitlab CI
~~~~~~~~~
Setting up ``GitlabCI`` is also easy:
1. Learn how `Gitlab CI works `_
2. Copy this configuration into your ``.gitlab-ci.yml``:
.. code:: yaml
image: python3.12
test:
before_script: pip install wemake-python-styleguide
script: flake8 .
Examples:
- ``GitlabCI`` + ``python`` `official template `_
- ``django`` + ``docker`` + ``GitlabCI`` `template `_
pre-commit
~~~~~~~~~~
To setup `pre-commit `_ with ``wemake-python-styleguide``, add a new hook to the project `.pre-commit-config.yaml` file.
For example:
.. code:: yaml
repos:
- repo: https://github.com/wemake-services/wemake-python-styleguide
rev: ...
hooks:
- id: wemake-python-styleguide