Skip to content
Snippets Groups Projects
Commit d3ee34ab authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add pre-commit hooks

Automatically run:
- black
- flake8

See https://pre-commit.com
parent eac87946
Branches pre-commit
No related tags found
1 merge request!7Add pre-commit hook
Pipeline #31712 failed
[flake8]
# E501: let black handle line length
# W503 is incompatible with PEP 8
ignore = E501,W503
image: docker:latest image: docker:latest
include:
- "https://gitlab.esss.lu.se/ics-infrastructure/gitlab-ci-yml/raw/master/PreCommit.gitlab-ci.yml"
variables: variables:
NGINX_IMAGE: "$CI_REGISTRY_IMAGE/nginx" NGINX_IMAGE: "$CI_REGISTRY_IMAGE/nginx"
PYTHON_SERVER_IMAGE: "$CI_REGISTRY_IMAGE/python-server" PYTHON_SERVER_IMAGE: "$CI_REGISTRY_IMAGE/python-server"
stages: stages:
- check
- build - build
- test
- release - release
- deploy - deploy
......
repos:
- repo: https://github.com/ambv/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: flake8
...@@ -8,6 +8,13 @@ This repository contains the structure to create the public opi screens running ...@@ -8,6 +8,13 @@ This repository contains the structure to create the public opi screens running
If you want to contribute to the screens the sequence is the following: If you want to contribute to the screens the sequence is the following:
- Install Docker on your computer and clone the git archive - Install Docker on your computer and clone the git archive
- Install pre-commit: https://pre-commit.com
- Install the git hook scripts (only required the first time you clone the repo):
```
pre-commit install
```
- Build the docker images with - Build the docker images with
``` ```
docker-compose build docker-compose build
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment