Skip to content

Commit 801dc83

Browse files
committed
Migrate to prek
1 parent 8c1c01d commit 801dc83

File tree

4 files changed

+25
-34
lines changed

4 files changed

+25
-34
lines changed

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/prek.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: prek checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
prek:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/[email protected]
13+
- uses: j178/[email protected]

README.rst

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -349,26 +349,20 @@ Running Locally with Docker
349349

350350
docker compose run --rm web python -m manage test
351351

352-
Pre-commit checks
352+
prek checks
353353
-----------------
354+
`pre-commit <https://pre-commit.com>`_ is a framework to run hooks written in many languages, and it manages the language toolchain and dependencies for running the hooks.
354355

355-
`pre-commit <https://pre-commit.com>`_ is a framework for managing pre-commit
356-
hooks. These hooks help to identify simple issues before committing code for
357-
review. By checking for these issues before code review it allows the reviewer
358-
to focus on the change itself, and it can also help to reduce the number of CI
359-
runs.
356+
prek is a reimagined version of pre-commit, built in Rust. It is designed to be a faster, dependency-free and drop-in alternative for it, while also providing some additional long-requested features.
360357

361-
To use the tool, first install ``pre-commit`` and then the git hooks
358+
Quoted from `prek's README.md <https://github.com/j178/prek/blob/ee7110b49bb1aa8d7b3ccee51c5241550cb0aec2/README.md>`_
362359

363-
.. code-block:: console
360+
To use the tool, first install ``prek`` and then the git hooks:
364361

365-
$ python3 -m pip install pre-commit
366-
$ python3 -m pre_commit install
362+
* Depending on your choice of platform and tooling, you can use the related installation instructions from https://prek.j178.dev/installation/
363+
* Install git hooks using ``prek install`` command: https://prek.j178.dev/cli/#prek-install
367364

368-
On the first commit ``pre-commit`` will install the hooks, these are
369-
installed in their own environments and will take a short while to
370-
install on the first run. Subsequent checks will be significantly faster.
371-
If the an error is found an appropriate error message will be displayed.
372-
If the error was with ``isort`` then the tool will go ahead and fix them for
373-
you. Review the changes and re-stage for commit if you are happy with
374-
them.
365+
The installed hooks will be triggered during each commit, or can be manually triggered via
366+
``prek run`` command: https://prek.j178.dev/cli/#prek-run If an error is found an appropriate
367+
error message will be displayed. If the error was with ``isort`` then the tool will go ahead
368+
and fix them for you. Review the changes and re-stage for commit if you are happy with them.

requirements/dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r common.txt
22
black==25.9.0 # Used by Django's find_formatters and run_formatters
33
django-debug-toolbar==6.0.0
4-
pre-commit~=4.3.0
4+
prek==0.2.5
55
psycopg[binary]==3.2.10
66
watchdog==6.0.0

0 commit comments

Comments
 (0)