Skip to content

Commit ae77540

Browse files
authored
feat: switch to prek (#656)
1 parent 81b7320 commit ae77540

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If you would like to make a pull request please:
2121

2222
1. Make a fork of the project
2323
2. Clone your fork locally
24-
3. Install `pre-commit` and the project's `pre-commit` hooks
24+
3. Install `prek` and the project's `pre-commit` hooks
2525
4. Test your changes with `pytest`
2626
5. Commit your changes to a feature branch of your fork, push to your branch
2727
6. Make a PR
@@ -74,12 +74,12 @@ Only include the actually modified baseline images in your PR! Running `git add
7474

7575
### Linting and Formatting
7676

77-
We use `pre-commit` to manage code formatting and linting. Make sure to run it before committing your changes:
77+
We use `prek` to manage code formatting and linting. Make sure to run it before committing your changes:
7878

79-
**With pre-commit**
79+
**With prek**
8080

8181
```bash
82-
pre-commit run --all-files
82+
prek run --all-files
8383
```
8484

8585
**With nox**

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def lint(session: nox.Session) -> None:
1616
"""
1717
Run the linter.
1818
"""
19-
session.install("pre-commit")
20-
session.run("pre-commit", "run", "--all-files", *session.posargs)
19+
session.install("prek")
20+
session.run("prek", "run", "--all-files", *session.posargs)
2121

2222

2323
@nox.session(python=PYTHON_ALL_VERSIONS)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies = [
3737
dev = [
3838
"bumpversion",
3939
"jupyter",
40-
"pre-commit",
40+
"prek",
4141
"questionary",
4242
"twine",
4343
]

src/mplhep/_dev.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ def cmd_precommit(self, extra_args: list[str] | None = None) -> bool:
289289
self._print_header("Running Pre-commit Hooks")
290290

291291
# Check if pre-commit is available
292-
if not self._check_tool_available("pre-commit", ["pre-commit", "--version"]):
292+
if not self._check_tool_available("prek", ["prek", "--version"]):
293293
return False
294294

295-
cmd = ["pre-commit", "run", "--all-files"]
295+
cmd = ["prek", "run", "--all-files"]
296296

297297
# Add any extra arguments
298298
if extra_args:
@@ -1056,7 +1056,7 @@ def make_menu_item(title, command_text):
10561056

10571057
menu_choices = [
10581058
(
1059-
make_menu_item("🔍 Run pre-commit", "pre-commit run --all-files"),
1059+
make_menu_item("🔍 Run pre-commit", "prek run --all-files"),
10601060
"precommit",
10611061
),
10621062
(

0 commit comments

Comments
 (0)