Skip to content

Commit

Permalink
Update pre-commit to use pinned version of dvc and correct stage …
Browse files Browse the repository at this point in the history
…names (#10621)

Co-authored-by: skshetry <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 18, 2024
1 parent 1e08cc5 commit 82e2446
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
name: DVC pre-commit
require_serial: true
stages:
- commit
- pre-commit
verbose: true
- args:
- git-hook
Expand All @@ -20,7 +20,7 @@
name: DVC pre-push
require_serial: true
stages:
- push
- pre-push
- always_run: true
args:
- git-hook
Expand All @@ -29,7 +29,7 @@
id: dvc-post-checkout
language: python
language_version: python3
minimum_pre_commit_version: 2.2.0
minimum_pre_commit_version: 3.2.0
name: DVC post-checkout
require_serial: true
stages:
Expand Down
7 changes: 4 additions & 3 deletions dvc/repo/install.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import TYPE_CHECKING

from dvc import version_tuple
from dvc.exceptions import DvcException

if TYPE_CHECKING:
Expand All @@ -16,19 +17,19 @@ def pre_commit_install(scm: "Git") -> None:
with modify_yaml(config_path) as config:
entry = {
"repo": "https://github.com/iterative/dvc",
"rev": "main",
"rev": ".".join(map(str, version_tuple[:3])),
"hooks": [
{
"id": "dvc-pre-commit",
"additional_dependencies": [".[all]"],
"language_version": "python3",
"stages": ["commit"],
"stages": ["pre-commit"],
},
{
"id": "dvc-pre-push",
"additional_dependencies": [".[all]"],
"language_version": "python3",
"stages": ["push"],
"stages": ["pre-push"],
},
{
"id": "dvc-post-checkout",
Expand Down

0 comments on commit 82e2446

Please sign in to comment.