Commit 4fd12267 authored by Felix Delattre's avatar Felix Delattre
Browse files

Added pre-commit

parent c484d8a9
Pipeline #22535 passed with stage
in 1 minute and 40 seconds
......@@ -4,7 +4,6 @@
*.egg-info
Pipfile
Pipfile.lock
.pre-commit-config.yaml
__pycache__
.cache
......
......@@ -4,6 +4,7 @@ before_script:
- python3 -V
- pip3 install pytest pytest-cov
- pip3 install git+https://git.gfz-potsdam.de/dynamicexposure/rabotnik/rabotnik.git
- pip3 install .[linters]
- pip3 install .[tests]
- pip3 install .
......
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 ]
......@@ -616,4 +616,4 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
\ No newline at end of file
END OF TERMS AND CONDITIONS
SOURCES=rcli tests
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
format: $(SOURCES)
black --line-length $(LENGTH) $^
format:
pre-commit run --all-files black
......@@ -10,7 +10,7 @@ tests_require = [
"pytest-cov",
]
linters_require = ["black>=20.8b1", "pylint", "flake8"]
linters_require = ["pylint", "pre-commit"]
setup(
name="rcli",
......@@ -19,7 +19,7 @@ setup(
author="Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ",
license="AGPLv3+",
install_requires=[
"rabotnik@https://git.gfz-potsdam.de/dynamicexposure/rabotnik/rabotnik/-/archive/master/rabotnik-master.zip"
"rabotnik@https://git.gfz-potsdam.de/dynamicexposure/rabotnik/rabotnik/-/archive/master/rabotnik-master.zip" # noqa: E501
],
tests_require=tests_require,
extras_require={
......
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