mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
Use pre-commit for Git hooks (#3406)
* Initial design of using pre-commit for Git hooks * Refactor to reuse existing code and provide merge capabilities * Linter fixes * More cleanup * scm: make use_precommit_tool optional * dvc: install our own hooks * install: fix typo * install: fix bugs in pre-commit integration * install: don't forget 'always_run' for post-checkout * install: no need to run pre-commit install if conf file doesn't exist * install: fix bugs * install: use python hooks * add .pre-commit-hooks.yaml Co-authored-by: Andrew Hare <[email protected]> Co-authored-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
co-authored by
Andrew Hare
Ruslan Kuprieiev
parent
dcf5af647e
commit
c4164b3497
@@ -0,0 +1,32 @@
|
||||
- args:
|
||||
- git-hook
|
||||
- pre-commit
|
||||
entry: dvc
|
||||
id: dvc-pre-commit
|
||||
language: python
|
||||
language_version: python3
|
||||
name: DVC pre-commit
|
||||
stages:
|
||||
- commit
|
||||
- args:
|
||||
- git-hook
|
||||
- pre-push
|
||||
entry: dvc
|
||||
id: dvc-pre-push
|
||||
language: python
|
||||
language_version: python3
|
||||
name: DVC pre-push
|
||||
stages:
|
||||
- push
|
||||
- always_run: true
|
||||
args:
|
||||
- git-hook
|
||||
- post-checkout
|
||||
entry: dvc
|
||||
id: dvc-post-checkout
|
||||
language: python
|
||||
language_version: python3
|
||||
minimum_pre_commit_version: 2.2.0
|
||||
name: DVC post-checkout
|
||||
stages:
|
||||
- post-checkout
|
||||
Reference in New Issue
Block a user