Commit d62ec3de authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

Added .pre-commit callable from Makefile. Removed pyupgrade

parent df068f87
Pipeline #22395 passed with stages
in 3 minutes and 12 seconds
......@@ -33,14 +33,6 @@ tests:
script:
- pytest tests
pyupgrade:
stage: test
interruptible: true
script:
- pip3 install .[linters] --quiet
- pyupgrade --py36-plus `find rabotnik -type f | grep py$`
- pyupgrade --py36-plus `find tests -type f | grep py$`
coverage:
stage: 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: check-builtin-literals
- 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=rabotnik tests setup.py
LENGTH=96
check:
pre-commit run --all-files
check: $(SOURCES)
flake8 --max-line-length=$(LENGTH) $^
black --check --line-length $(LENGTH) $^
pylint -E $^
install:
pip install .[tests]
pip install .[linters]
pip install -e .
pre-commit install
black: $(SOURCES)
black --line-length $(LENGTH) $^
format:
pre-commit run --all-files black
documentation:
pdoc --html rabotnik -o docs/build -f
......
......@@ -22,6 +22,18 @@ Installation
pip3 install .
Contributing
------------
Development and linting dependencies can be installed with:
pip3 install .[tests]
pip3 install .[linters]
We use `black` and `flake8` for consistent code style and `pylint` for general linting. Project linting comes pre-defined in `.pre-commit` to be used in `https://pre-commit.com/`_.
pre-commit install
Copyright and copyleft
----------------------
......
......@@ -32,7 +32,7 @@ tests_require = [
"pdoc3",
]
linters_require = ["black>=20.8b1", "pylint", "flake8", "pyupgrade"]
linters_require = ["pre-commit", "pylint"]
setup(
name="rabotnik",
......
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