Spaces:
Runtime error
Runtime error
Matthew Upson
commited on
new: Add pre-commit
Browse files- .pre-commit-config.yaml +28 -0
- Makefile +1 -1
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
repos:
|
| 2 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 3 |
+
rev: v4.1.0
|
| 4 |
+
hooks:
|
| 5 |
+
- id: check-yaml
|
| 6 |
+
- id: trailing-whitespace
|
| 7 |
+
- id: mixed-line-ending
|
| 8 |
+
- repo: https://github.com/psf/black
|
| 9 |
+
rev: 22.3.0
|
| 10 |
+
hooks:
|
| 11 |
+
- id: black
|
| 12 |
+
- repo: https://github.com/iterative/dvc
|
| 13 |
+
rev: 2.10.0
|
| 14 |
+
hooks:
|
| 15 |
+
- id: dvc-pre-commit
|
| 16 |
+
language_version: python3
|
| 17 |
+
stages:
|
| 18 |
+
- commit
|
| 19 |
+
- id: dvc-pre-push
|
| 20 |
+
additional_dependencies: ['.[s3]']
|
| 21 |
+
language_version: python3
|
| 22 |
+
stages:
|
| 23 |
+
- push
|
| 24 |
+
- id: dvc-post-checkout
|
| 25 |
+
language_version: python3
|
| 26 |
+
stages:
|
| 27 |
+
- post-checkout
|
| 28 |
+
always_run: true
|
Makefile
CHANGED
|
@@ -19,7 +19,7 @@ $(VIRTUALENV)/.installed: requirements.txt
|
|
| 19 |
virtualenv --python $(PYTHON_VERSION) $(VIRTUALENV)
|
| 20 |
$(VIRTUALENV)/bin/pip3 install -r requirements.txt
|
| 21 |
$(VIRTUALENV)/bin/pip3 install -r requirements_dev.txt
|
| 22 |
-
|
| 23 |
touch $@
|
| 24 |
|
| 25 |
# Update the requirements to latest. This is required because typically we won't
|
|
|
|
| 19 |
virtualenv --python $(PYTHON_VERSION) $(VIRTUALENV)
|
| 20 |
$(VIRTUALENV)/bin/pip3 install -r requirements.txt
|
| 21 |
$(VIRTUALENV)/bin/pip3 install -r requirements_dev.txt
|
| 22 |
+
${VIRTUALENV}/bin/pre-commit install --hook-type pre-push --hook-type post-checkout --hook-type pre-commit
|
| 23 |
touch $@
|
| 24 |
|
| 25 |
# Update the requirements to latest. This is required because typically we won't
|