Skip to content

Commit e23275e

Browse files
committed
Migrate to prek
# Conflicts: # README.rst
1 parent 14bd859 commit e23275e

File tree

4 files changed

+26
-35
lines changed

4 files changed

+26
-35
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: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -370,26 +370,20 @@ Running Locally with Docker
370370

371371
7. View the docs at http://docs.djangoproject.localhost:8000/.
372372

373-
Pre-commit checks
374-
-----------------
373+
git hooks
374+
---------
375+
`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.
375376

376-
`pre-commit <https://pre-commit.com>`_ is a framework for managing pre-commit
377-
hooks. These hooks help to identify simple issues before committing code for
378-
review. By checking for these issues before code review it allows the reviewer
379-
to focus on the change itself, and it can also help to reduce the number of CI
380-
runs.
377+
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.
381378

382-
To use the tool, first install ``pre-commit`` and then the git hooks
379+
\- quoted from `prek's README.md <https://github.com/j178/prek/blob/ee7110b49bb1aa8d7b3ccee51c5241550cb0aec2/README.md>`_
383380

384-
.. code-block:: console
381+
To use git hooks locally, first install ``prek`` and then the git hooks:
385382

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

389-
On the first commit ``pre-commit`` will install the hooks, these are
390-
installed in their own environments and will take a short while to
391-
install on the first run. Subsequent checks will be significantly faster.
392-
If the an error is found an appropriate error message will be displayed.
393-
If the error was with ``isort`` then the tool will go ahead and fix them for
394-
you. Review the changes and re-stage for commit if you are happy with
395-
them.
386+
The installed hooks will be triggered during each commit, or can be manually triggered via
387+
``prek run`` command: https://prek.j178.dev/cli/#prek-run If an error is found an appropriate
388+
error message will be displayed. If the error was with ``isort`` then the tool will go ahead
389+
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)