Commit a265e042 authored by Marius Kriegerowski's avatar Marius Kriegerowski Committed by Graeme Weatherill
Browse files

add pre-commit configuration, docs and gitlab-ci integration

parent 249d6358
Pipeline #23360 passed with stage
in 12 minutes and 28 seconds
......@@ -20,7 +20,7 @@ before_script:
formatting:
interruptible: true
script:
- make check
- pre-commit run --all-files
test:
interruptible: true
......
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args: [ --line-length=96 ]
- repo: https://github.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
args: [--max-line-length=96]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
args: [ --disable=E0611, -E, -j4 ]
types: [ python ]
SOURCES=shakyground2 tests *.py
LENGTH=96
check: $(SOURCES)
flake8 --max-line-length=$(LENGTH) $^
black --check --line-length $(LENGTH) $^
pylint -E $^
black: $(SOURCES)
black --line-length $(LENGTH) $^
......@@ -8,10 +8,10 @@ Install development and test dependencies with
pip3 install .[tests]
Before committing make check or correct your code style
Before committing make check or correct your code style. Style and consistency will be checked automatically using (pre-commit)[https://pre-commit.com/]. Install the required hooks as follows:
make check
pre-commit install
or
To manually trigger the installed hooks execute:
make black
pre-commit run --all-files
......@@ -2,7 +2,7 @@
from setuptools import setup, find_packages
test_requirements = ["pylint", "flake8", "black", "pytest"]
test_requirements = ["pylint", "pytest", "pre-commit"]
setup(
name="shakyground2",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment