Skip to content

Commit 20aaa7d

Browse files
committed
feat(prek): support 'prek' as an alternative to 'pre-commit' in project_info
1 parent 21c8043 commit 20aaa7d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

commitizen/project_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def is_pre_commit_installed() -> bool:
9-
return bool(shutil.which("pre-commit"))
9+
return bool(shutil.which("pre-commit")) or bool(shutil.which("prek"))
1010

1111

1212
def get_default_version_provider() -> Literal[

tests/test_project_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def _create_project_files(files: dict[str, str | None]) -> None:
2222
"which_return, expected",
2323
[
2424
("/usr/local/bin/pre-commit", True),
25+
("/usr/local/bin/prek", True),
2526
(None, False),
2627
("", False),
2728
],

0 commit comments

Comments
 (0)