@j178/prek 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.11
4
+
5
+ Released on 2025-10-24.
6
+
7
+ ### Enhancements
8
+
9
+ - Support `language: lua` hooks ([#954](https://github.com/j178/prek/pull/954))
10
+ - Support `language_version: system` ([#949](https://github.com/j178/prek/pull/949))
11
+ - Implement `no-commit-to-branch` as builtin hook ([#930](https://github.com/j178/prek/pull/930))
12
+ - Improve styling for stashing error message ([#953](https://github.com/j178/prek/pull/953))
13
+ - Support nix-shell style shebang ([#929](https://github.com/j178/prek/pull/929))
14
+
15
+ ### Documentation
16
+
17
+ - Add a page about "Quick start" ([#934](https://github.com/j178/prek/pull/934))
18
+ - Add kreuzberg to "who is using prek" ([#936](https://github.com/j178/prek/pull/936))
19
+ - Clarify minimum mise version required to use `mise use prek` ([#931](https://github.com/j178/prek/pull/931))
20
+
21
+ ### Contributors
22
+
23
+ - @fllesser
24
+ - @j178
25
+
26
+ ## 0.2.10
27
+
28
+ Released on 2025-10-18.
29
+
30
+ ### Enhancements
31
+
32
+ - Add `--fail-fast` CLI flag to stop after first hook failure ([#908](https://github.com/j178/prek/pull/908))
33
+ - Add collision detection for hook env directories ([#914](https://github.com/j178/prek/pull/914))
34
+ - Error out if not projects found ([#913](https://github.com/j178/prek/pull/913))
35
+ - Implement `check-xml` as builtin hook ([#894](https://github.com/j178/prek/pull/894))
36
+ - Implement `check-merge-conflict` as builtin hook ([#885](https://github.com/j178/prek/pull/885))
37
+ - Use line-by-line reading in `check-merge-conflict` ([#910](https://github.com/j178/prek/pull/910))
38
+
39
+ ### Bug fixes
40
+
41
+ - Fix pygrep hook env health check ([#921](https://github.com/j178/prek/pull/921))
42
+ - Group `pygrep` with `python` when installing pygrep hooks ([#920](https://github.com/j178/prek/pull/920))
43
+ - Ignore `.` prefixed directory when searching managed Python for pygrep ([#919](https://github.com/j178/prek/pull/919))
44
+
45
+ ### Documentation
46
+
47
+ - Add contribution guide ([#912](https://github.com/j178/prek/pull/912))
48
+
49
+ ### Other changes
50
+
51
+ ### Contributors
52
+
53
+ - @AdityasWorks
54
+ - @j178
55
+ - @kenwoodjw
56
+ - @lmmx
57
+
3
58
  ## 0.2.9
4
59
 
5
60
  Released on 2025-10-16.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # prek
4
4
 
5
- <img width="220" alt="prek" src="./docs/assets/logo_512.webp" />
5
+ <img width="220" alt="prek" src="./docs/assets/logo.webp" />
6
6
 
7
7
  [![CI](https://github.com/j178/prek/actions/workflows/ci.yml/badge.svg)](https://github.com/j178/prek/actions/workflows/ci.yml)
8
8
  [![codecov](https://codecov.io/github/j178/prek/graph/badge.svg?token=MP6TY24F43)](https://codecov.io/github/j178/prek)
@@ -24,7 +24,7 @@ while also providing some additional long-requested features.
24
24
  > [!WARNING]
25
25
  > prek is not production-ready yet. Some subcommands and languages are not implemented. See the current gaps for drop-in parity: [TODO](https://prek.j178.dev/todo/).
26
26
  >
27
- > It's already being adopted by [some projects](#who-is-using-prek), please give it a try - we'd love your feedback!
27
+ > But it's already being adopted by [some projects](#who-is-using-prek) like Airflow, so please give it a try - we'd love your feedback!
28
28
 
29
29
  <!-- features:start -->
30
30
  ## Features
@@ -38,64 +38,13 @@ while also providing some additional long-requested features.
38
38
  - 📦 [Built-in](https://prek.j178.dev/builtin/) Rust-native implementation of some common hooks.
39
39
  <!-- features:end -->
40
40
 
41
- ## How to migrate
41
+ ## Table of contents
42
42
 
43
- prek is designed as a drop-in replacement:
44
-
45
- - [Install prek](#installation)
46
- - Replace `pre-commit` with `prek` in your commands
47
- - Your existing `.pre-commit-config.yaml` works unchanged
48
-
49
- ```console
50
- $ prek run
51
- trim trailing whitespace.................................................Passed
52
- fix end of files.........................................................Passed
53
- typos....................................................................Passed
54
- cargo fmt................................................................Passed
55
- cargo clippy.............................................................Passed
56
- ```
57
-
58
- For configuring `.pre-commit-config.yaml` and writing hooks, you can refer to the [pre-commit documentation](https://pre-commit.com/) as prek is fully compatible with it.
59
-
60
- <!-- why:start -->
61
- ## Why prek?
62
-
63
- ### prek is faster
64
-
65
- - It is [multiple times faster](https://prek.j178.dev/benchmark/) than `pre-commit` and takes up half the disk space.
66
- - It redesigned how hook environments and toolchains are managed, they are all shared between hooks, which reduces the disk space usage and speeds up the installation process.
67
- - Repositories are cloned in parallel, and hooks are installed in parallel if their dependencies are disjoint.
68
- - It uses [`uv`](https://github.com/astral-sh/uv) for creating Python virtualenvs and installing dependencies, which is known for its speed and efficiency.
69
- - It implements some common hooks in Rust, [built in prek](https://prek.j178.dev/builtin/), which are faster than their Python counterparts.
70
-
71
- ### prek provides a better user experience
72
-
73
- - No need to install Python or any other runtime, just download a single binary.
74
- - No hassle with your Python version or virtual environments, prek automatically installs the required Python version and creates a virtual environment for you.
75
- - Built-in support for workspaces (or monorepos), each subproject can have its own `.pre-commit-config.yaml` file.
76
- - `prek run` has some nifty improvements over `pre-commit run`, such as:
77
- - `prek run --directory <dir>` runs hooks for files in the specified directory, no need to use `git ls-files -- <dir> | xargs pre-commit run --files` anymore.
78
- - `prek run --last-commit` runs hooks for files changed in the last commit.
79
- - `prek run [HOOK] [HOOK]` selects and runs multiple hooks.
80
- - `prek list` command lists all available hooks, their ids, and descriptions, providing a better overview of the configured hooks.
81
- - prek provides shell completions for `prek run <hook_id>` command, making it easier to run specific hooks without remembering their ids.
82
-
83
- For more detailed improvements prek offers, take a look at [Difference from pre-commit](https://prek.j178.dev/diff/).
84
-
85
- ## Who is using prek?
86
-
87
- prek is pretty new, but it is already being used or recommend by some projects and organizations:
88
-
89
- - [Airflow](https://github.com/apache/airflow/issues/44995)
90
- - [PDM](https://github.com/pdm-project/pdm/pull/3593)
91
- - [basedpyright](https://github.com/DetachHead/basedpyright/pull/1413)
92
- - [OpenLineage](https://github.com/OpenLineage/OpenLineage/pull/3965)
93
- - [Authlib](https://github.com/authlib/authlib/pull/804)
94
- - [pre-commit-crocodile](https://radiandevcore.gitlab.io/tools/pre-commit-crocodile/)
95
- - [PaperQA2](https://github.com/Future-House/paper-qa/pull/1098)
96
- - [requests-cache](https://github.com/requests-cache/requests-cache/pull/1116)
97
-
98
- <!-- why:end -->
43
+ - [Installation](#installation)
44
+ - [Quick start](#quick-start)
45
+ - [Why prek?](#why-prek)
46
+ - [Who is using prek?](#who-is-using-prek)
47
+ - [Acknowledgements](#acknowledgements)
99
48
 
100
49
  ## Installation
101
50
 
@@ -108,7 +57,7 @@ On Linux and macOS:
108
57
 
109
58
  <!-- linux-standalone-install:start -->
110
59
  ```bash
111
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.2.9/prek-installer.sh | sh
60
+ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.2.11/prek-installer.sh | sh
112
61
  ```
113
62
  <!-- linux-standalone-install:end -->
114
63
 
@@ -116,7 +65,7 @@ On Windows:
116
65
 
117
66
  <!-- windows-standalone-install:start -->
118
67
  ```powershell
119
- powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.2.9/prek-installer.ps1 | iex"
68
+ powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.2.11/prek-installer.ps1 | iex"
120
69
  ```
121
70
  <!-- windows-standalone-install:end -->
122
71
 
@@ -132,6 +81,9 @@ prek is published as Python binary wheel to PyPI, you can install it using `pip`
132
81
  # Using uv (recommended)
133
82
  uv tool install prek
134
83
 
84
+ # Using uvx (install and run in one command)
85
+ uvx prek
86
+
135
87
  # Using pip
136
88
  pip install prek
137
89
 
@@ -157,7 +109,7 @@ brew install prek
157
109
  <summary>mise</summary>
158
110
 
159
111
  <!-- mise-install:start -->
160
- To use prek with [mise](https://mise.jdx.dev):
112
+ To use prek with [mise](https://mise.jdx.dev) ([v2025.8.11](https://github.com/jdx/mise/releases/tag/v2025.8.11) or later):
161
113
 
162
114
  ```bash
163
115
  mise use prek
@@ -170,7 +122,7 @@ mise use prek
170
122
  <summary>Cargo binstall</summary>
171
123
 
172
124
  <!-- cargo-binstall:start -->
173
- Install pre-compiled binaries from GitHub using Cargo binstall (Rust 1.89+ is required):
125
+ Install pre-compiled binaries from GitHub using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall):
174
126
 
175
127
  ```bash
176
128
  cargo binstall prek --git https://github.com/j178/prek
@@ -291,6 +243,52 @@ prek self update
291
243
  ```
292
244
  <!-- self-update:end -->
293
245
 
246
+ ## Quick start
247
+
248
+ - **I already use pre-commit:** follow the short migration checklist in the [quickstart guide](https://prek.j178.dev/quickstart/#already-using-pre-commit) to swap in `prek` safely.
249
+ - **I'm new to pre-commit-style tools:** learn the basics—creating a config, running hooks, and installing git hooks—in the [beginner quickstart walkthrough](https://prek.j178.dev/quickstart/#new-to-pre-commit-style-workflows).
250
+
251
+ <!-- why:start -->
252
+ ## Why prek?
253
+
254
+ ### prek is faster
255
+
256
+ - It is [multiple times faster](https://prek.j178.dev/benchmark/) than `pre-commit` and takes up half the disk space.
257
+ - It redesigned how hook environments and toolchains are managed, they are all shared between hooks, which reduces the disk space usage and speeds up the installation process.
258
+ - Repositories are cloned in parallel, and hooks are installed in parallel if their dependencies are disjoint.
259
+ - It uses [`uv`](https://github.com/astral-sh/uv) for creating Python virtualenvs and installing dependencies, which is known for its speed and efficiency.
260
+ - It implements some common hooks in Rust, [built in prek](https://prek.j178.dev/builtin/), which are faster than their Python counterparts.
261
+
262
+ ### prek provides a better user experience
263
+
264
+ - No need to install Python or any other runtime, just download a single binary.
265
+ - No hassle with your Python version or virtual environments, prek automatically installs the required Python version and creates a virtual environment for you.
266
+ - Built-in support for [workspaces](https://prek.j178.dev/workspace/) (or monorepos), each subproject can have its own `.pre-commit-config.yaml` file.
267
+ - [`prek run`](https://prek.j178.dev/cli/#prek-run) has some nifty improvements over `pre-commit run`, such as:
268
+ - `prek run --directory <dir>` runs hooks for files in the specified directory, no need to use `git ls-files -- <dir> | xargs pre-commit run --files` anymore.
269
+ - `prek run --last-commit` runs hooks for files changed in the last commit.
270
+ - `prek run [HOOK] [HOOK]` selects and runs multiple hooks.
271
+ - [`prek list`](https://prek.j178.dev/cli/#prek-list) command lists all available hooks, their ids, and descriptions, providing a better overview of the configured hooks.
272
+ - prek provides shell completions for `prek run <hook_id>` command, making it easier to run specific hooks without remembering their ids.
273
+
274
+ For more detailed improvements prek offers, take a look at [Difference from pre-commit](https://prek.j178.dev/diff/).
275
+
276
+ ## Who is using prek?
277
+
278
+ prek is pretty new, but it is already being used or recommend by some projects and organizations:
279
+
280
+ - [Airflow](https://github.com/apache/airflow/issues/44995)
281
+ - [PDM](https://github.com/pdm-project/pdm/pull/3593)
282
+ - [basedpyright](https://github.com/DetachHead/basedpyright/pull/1413)
283
+ - [OpenLineage](https://github.com/OpenLineage/OpenLineage/pull/3965)
284
+ - [Authlib](https://github.com/authlib/authlib/pull/804)
285
+ - [pre-commit-crocodile](https://radiandevcore.gitlab.io/tools/pre-commit-crocodile/)
286
+ - [PaperQA2](https://github.com/Future-House/paper-qa/pull/1098)
287
+ - [requests-cache](https://github.com/requests-cache/requests-cache/pull/1116)
288
+ - [kreuzberg](https://github.com/Goldziher/kreuzberg/pull/142)
289
+
290
+ <!-- why:end -->
291
+
294
292
  ## Acknowledgements
295
293
 
296
294
  This project is heavily inspired by the original [pre-commit](https://pre-commit.com/) tool, and it wouldn't be possible without the hard work
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@j178/prek",
26
- "version": "0.2.9"
26
+ "version": "0.2.11"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -896,5 +896,5 @@
896
896
  }
897
897
  },
898
898
  "requires": true,
899
- "version": "0.2.9"
899
+ "version": "0.2.11"
900
900
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/j178/prek/releases/download/v0.2.9",
2
+ "artifactDownloadUrl": "https://github.com/j178/prek/releases/download/v0.2.11",
3
3
  "author": "j178 <hi@j178.dev>",
4
4
  "bin": {
5
5
  "prek": "run-prek.js"
@@ -224,7 +224,7 @@
224
224
  "zipExt": ".tar.gz"
225
225
  }
226
226
  },
227
- "version": "0.2.9",
227
+ "version": "0.2.11",
228
228
  "volta": {
229
229
  "node": "18.14.1",
230
230
  "npm": "9.5.0"