@j178/prek 0.3.0 → 0.3.2

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,162 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2
4
+
5
+ Released on 2026-02-06.
6
+
7
+ ### Highlights
8
+
9
+ - **`prek.toml` is here!**
10
+
11
+ You can now use `prek.toml` as an alternative to `.pre-commit-config.yaml` for configuring prek. `prek.toml` mirrors the structure of `.pre-commit-config.yaml`, but TOML is less error-prone. Your existing `.pre-commit-config.yaml` will continue to work, but for new users and new projects, `prek.toml` may make more sense. If you want to switch, run `prek util yaml-to-toml` to convert YAML configs to `prek.toml`. See [configuration docs](configuration.md) for details.
12
+
13
+ For example, this config:
14
+
15
+ ```yaml
16
+ repos:
17
+ - repo: https://github.com/pre-commit/pre-commit-hooks
18
+ rev: v6.0.0
19
+ hooks:
20
+ - id: check-yaml
21
+ ```
22
+
23
+ Can be written as `prek.toml` like this:
24
+
25
+ ```toml
26
+ [[repos]]
27
+ repo = "https://github.com/pre-commit/pre-commit-hooks"
28
+ rev = "v6.0.0"
29
+ hooks = [ { id = "check-yaml" } ]
30
+ ```
31
+
32
+ - **`serde-yaml` has been replaced with `serde-saphyr`**
33
+
34
+ We replaced the long-deprecated `serde-yaml` crate with [`serde-saphyr`](https://crates.io/crates/serde-saphyr) for YAML parsing. It is written in safe Rust and has better error messages, performance, and security. This lets us provide precise location information for configuration parsing errors, which should make it easier to fix config issues.
35
+
36
+ For example, this invalid config:
37
+
38
+ ```yaml
39
+ repos:
40
+ - repo: https://github.com/crate-ci/typos
41
+ hooks:
42
+ - id: typos
43
+ ```
44
+
45
+ Before:
46
+
47
+ ```console
48
+ $ prek run
49
+ error: Failed to parse `.pre-commit-config.yaml`
50
+ caused by: Invalid remote repo: missing field `rev`
51
+ ```
52
+
53
+ Now:
54
+
55
+ ```console
56
+ $ prek run
57
+ error: Failed to parse `.pre-commit-config.yaml`
58
+ caused by: error: line 2 column 5: missing field `rev` at line 2, column 5
59
+ --> <input>:2:5
60
+ |
61
+ 1 | repos:
62
+ 2 | - repo: https://github.com/crate-ci/typos
63
+ | ^ missing field `rev` at line 2, column 5
64
+ 3 | hooks:
65
+ 4 | - id: typos
66
+ |
67
+ ```
68
+
69
+ - **`prek util` subcommands**
70
+
71
+ We added a new `prek util` top-level command for miscellaneous utilities that don't fit into other categories. The first two utilities are:
72
+
73
+ - `prek util identify`: shows the identification tags of files that prek uses for file filtering, which can be useful for debugging and writing `types/types_or/exclude_types` filters.
74
+ - `prek util yaml-to-toml`: converts `.pre-commit-config.yaml` to `prek.toml`.
75
+
76
+ We also moved `prek init-template-dir` under `prek util` for better organization. The old `prek init-template-dir` command is still available (hidden) as an alias for backward compatibility.
77
+
78
+ ### Enhancements
79
+
80
+ - Add `prek util identify` subcommand ([#1554](https://github.com/j178/prek/pull/1554))
81
+ - Add `prek util yaml-to-toml` to convert `.pre-commit-config.yaml` to `prek.toml` ([#1584](https://github.com/j178/prek/pull/1584))
82
+ - Detect install source for actionable upgrade hints ([#1540](https://github.com/j178/prek/pull/1540))
83
+ - Detect prek installed by the standalone installer ([#1545](https://github.com/j178/prek/pull/1545))
84
+ - Implement `serialize_yaml_scalar` using `serde-saphyr` ([#1534](https://github.com/j178/prek/pull/1534))
85
+ - Improve max cli arguments length calculation ([#1518](https://github.com/j178/prek/pull/1518))
86
+ - Move `identify` and `init-template-dir` under the `prek util` top-level command ([#1574](https://github.com/j178/prek/pull/1574))
87
+ - Replace serde-yaml with serde-saphyr (again) ([#1520](https://github.com/j178/prek/pull/1520))
88
+ - Show precise location for config parsing error ([#1530](https://github.com/j178/prek/pull/1530))
89
+ - Support `Julia` language ([#1519](https://github.com/j178/prek/pull/1519))
90
+ - Support `prek.toml` ([#1271](https://github.com/j178/prek/pull/1271))
91
+ - Added `PREK_QUIET` environment variable support ([#1513](https://github.com/j178/prek/pull/1513))
92
+ - Remove upper bound constraint of uv version ([#1588](https://github.com/j178/prek/pull/1588))
93
+
94
+ ### Bug fixes
95
+
96
+ - Do not make the child a session leader ([#1586](https://github.com/j178/prek/pull/1586))
97
+ - Fix FilePattern schema to accept plain strings ([#1564](https://github.com/j178/prek/pull/1564))
98
+ - Use semver fallback sort when tag timestamps are equal ([#1579](https://github.com/j178/prek/pull/1579))
99
+
100
+ ### Documentation
101
+
102
+ - Add `OpenClaw` to the list of users ([#1517](https://github.com/j178/prek/pull/1517))
103
+ - Add `cachix/devenv`, `apache/lucene`, `copper-project/copper-rs` as projects using prek ([#1531](https://github.com/j178/prek/pull/1531), [#1514](https://github.com/j178/prek/pull/1514), [#1569](https://github.com/j178/prek/pull/1569))
104
+ - Add document about authoring remote hooks ([#1571](https://github.com/j178/prek/pull/1571))
105
+ - Add `llms.txt` generation for LLM-friendly documentation ([#1553](https://github.com/j178/prek/pull/1553))
106
+ - Document using `--refresh` to pick up `.prekignore` changes ([#1575](https://github.com/j178/prek/pull/1575))
107
+ - Fix PowerShell completion instruction syntax ([#1568](https://github.com/j178/prek/pull/1568))
108
+ - Update quick start to use `prek.toml` ([#1576](https://github.com/j178/prek/pull/1576))
109
+
110
+ ### Other changes
111
+
112
+ - Include `prek.toml` in run hint for config filename ([#1578](https://github.com/j178/prek/pull/1578))
113
+
114
+ ### Contributors
115
+
116
+ - @fatelei
117
+ - @domenkozar
118
+ - @makeecat
119
+ - @fllesser
120
+ - @j178
121
+ - @copilot-swe-agent
122
+ - @oopscompiled
123
+ - @rmuir
124
+ - @shaanmajid
125
+
126
+ ## 0.3.1
127
+
128
+ Released on 2026-01-31.
129
+
130
+ ### Enhancements
131
+
132
+ - Add `language: swift` support ([#1463](https://github.com/j178/prek/pull/1463))
133
+ - Add `language: haskell` support ([#1484](https://github.com/j178/prek/pull/1484))
134
+ - Extract go version constraint from `go.mod` ([#1457](https://github.com/j178/prek/pull/1457))
135
+ - Warn when config file exists but fails to parse ([#1487](https://github.com/j178/prek/pull/1487))
136
+ - Add GitHub artifact attestations to release and build-docker workflow ([#1494](https://github.com/j178/prek/pull/1494), [#1497](https://github.com/j178/prek/pull/1497))
137
+ - Allow `GIT_CONFIG_PARAMETERS` for private repository authentication ([#1472](https://github.com/j178/prek/pull/1472))
138
+ - Show progress bar when running builtin hooks ([#1504](https://github.com/j178/prek/pull/1504))
139
+
140
+ ### Bug fixes
141
+
142
+ - Cap ARG_MAX at `1<<19` for safety ([#1506](https://github.com/j178/prek/pull/1506))
143
+ - Don't check Python executable path in health check ([#1496](https://github.com/j178/prek/pull/1496))
144
+
145
+ ### Documentation
146
+
147
+ - Include `CocoIndex` as a project using prek ([#1477](https://github.com/j178/prek/pull/1477))
148
+ - Add commands for artifact verification using GitHub Attestations ([#1500](https://github.com/j178/prek/pull/1500))
149
+
150
+ ### Contributors
151
+
152
+ - @halms
153
+ - @Haleshot
154
+ - @simono
155
+ - @tisonkun
156
+ - @fllesser
157
+ - @j178
158
+ - @shaanmajid
159
+
3
160
  ## 0.3.0
4
161
 
5
162
  Released on 2026-01-22.
@@ -7,7 +164,6 @@ Released on 2026-01-22.
7
164
  ### Highlights
8
165
 
9
166
  - `prek cache gc` (also available via `prek gc` for pre-commit compatibility) is finally here! You can now run `prek cache gc` to clean up unused repos, hook envs and tool versions from prek cache.
10
-
11
167
  - `language: bun` is now supported, making it possible to write and run hooks with [Bun](https://bun.sh/).
12
168
 
13
169
  ### Enhancements
package/README.md CHANGED
@@ -27,19 +27,19 @@ while also providing some additional long-requested features.
27
27
  > [!NOTE]
28
28
  > Although prek is pretty new, it’s already powering real‑world projects like [CPython](https://github.com/python/cpython), [Apache Airflow](https://github.com/apache/airflow), [FastAPI](https://github.com/fastapi/fastapi), and more projects are picking it up—see [Who is using prek?](#who-is-using-prek). If you’re looking for an alternative to `pre-commit`, please give it a try—we’d love your feedback!
29
29
  >
30
- > Please note that some subcommands and languages are still missing for full drop‑in parity with `pre-commit`. Track the remaining gaps here: [TODO](https://prek.j178.dev/todo/).
30
+ > Please note that some languages are not yet supported for full drop‑in parity with `pre-commit`. See [Language Support](https://prek.j178.dev/languages/) for current status.
31
31
 
32
32
  <!-- --8<-- [start:features] -->
33
33
 
34
34
  ## Features
35
35
 
36
- - 🚀 A single binary with no dependencies, does not require Python or any other runtime.
37
- - ⚡ [Faster](https://prek.j178.dev/benchmark/) than `pre-commit` and more efficient in disk space usage.
38
- - 🔄 Fully compatible with the original pre-commit configurations and hooks.
39
- - 🏗️ Built-in support for monorepos (i.e. [workspace mode](https://prek.j178.dev/workspace/)).
40
- - 🐍 Integration with [`uv`](https://github.com/astral-sh/uv) for managing Python virtual environments and dependencies.
41
- - 🛠️ Improved toolchain installations for Python, Node.js, Bun, Go, Rust and Ruby, shared between hooks.
42
- - 📦 [Built-in](https://prek.j178.dev/builtin/) Rust-native implementation of some common hooks.
36
+ - A single binary with no dependencies, does not require Python or any other runtime.
37
+ - [Faster](https://prek.j178.dev/benchmark/) than `pre-commit` and more efficient in disk space usage.
38
+ - Fully compatible with the original pre-commit configurations and hooks.
39
+ - Built-in support for monorepos (i.e. [workspace mode](https://prek.j178.dev/workspace/)).
40
+ - Integration with [`uv`](https://github.com/astral-sh/uv) for managing Python virtual environments and dependencies.
41
+ - Improved toolchain installations for Python, Node.js, Bun, Go, Rust and Ruby, shared between hooks.
42
+ - [Built-in](https://prek.j178.dev/builtin/) Rust-native implementation of some common hooks.
43
43
 
44
44
  <!-- --8<-- [end:features] -->
45
45
 
@@ -63,7 +63,7 @@ On Linux and macOS:
63
63
  <!-- --8<-- [start: linux-standalone-install] -->
64
64
 
65
65
  ```bash
66
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.3.0/prek-installer.sh | sh
66
+ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.3.2/prek-installer.sh | sh
67
67
  ```
68
68
 
69
69
  <!-- --8<-- [end: linux-standalone-install] -->
@@ -73,7 +73,7 @@ On Windows:
73
73
  <!-- --8<-- [start: windows-standalone-install] -->
74
74
 
75
75
  ```powershell
76
- powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.3.0/prek-installer.ps1 | iex"
76
+ powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.3.2/prek-installer.ps1 | iex"
77
77
  ```
78
78
 
79
79
  <!-- --8<-- [end: windows-standalone-install] -->
@@ -171,23 +171,23 @@ cargo install --locked prek
171
171
 
172
172
  <!-- --8<-- [start: npmjs-install] -->
173
173
 
174
- prek is published as a Node.js package, you can install it using `npm`, `pnpm`, or `npx`:
174
+ prek is published as a [Node.js package](https://www.npmjs.com/package/@j178/prek)
175
+ and can be installed with any npm-compatible package manager:
175
176
 
176
177
  ```bash
177
- # Using npm
178
+ # As a dev dependency
178
179
  npm add -D @j178/prek
179
-
180
- # Using pnpm
181
180
  pnpm add -D @j178/prek
181
+ bun add -D @j178/prek
182
182
 
183
- # Using npx
184
- npx @j178/prek --version
185
-
186
- # or install globally
183
+ # Or install globally
187
184
  npm install -g @j178/prek
185
+ pnpm add -g @j178/prek
186
+ bun install -g @j178/prek
188
187
 
189
- # then use `prek` command
190
- prek --version
188
+ # Or run directly without installing
189
+ npx @j178/prek --version
190
+ bunx @j178/prek --version
191
191
  ```
192
192
 
193
193
  <!-- --8<-- [end: npmjs-install] -->
@@ -358,6 +358,7 @@ prek is pretty new, but it is already being used or recommend by some projects a
358
358
  - [fastapi/asyncer](https://github.com/fastapi/asyncer/pull/437)
359
359
  - [astral-sh/ruff](https://github.com/astral-sh/ruff/pull/22505)
360
360
  - [astral-sh/ty](https://github.com/astral-sh/ty/pull/2469)
361
+ - [openclaw/openclaw](https://github.com/openclaw/openclaw/pull/1720)
361
362
  - [home-assistant/core](https://github.com/home-assistant/core/pull/160427)
362
363
  - [DetachHead/basedpyright](https://github.com/DetachHead/basedpyright/pull/1413)
363
364
  - [OpenLineage/OpenLineage](https://github.com/OpenLineage/OpenLineage/pull/3965)
@@ -369,12 +370,16 @@ prek is pretty new, but it is already being used or recommend by some projects a
369
370
  - [python-attrs/attrs](https://github.com/python-attrs/attrs/commit/c95b177682e76a63478d29d040f9cb36a8d31915)
370
371
  - [jlowin/fastmcp](https://github.com/jlowin/fastmcp/pull/2309)
371
372
  - [apache/iceberg-python](https://github.com/apache/iceberg-python/pull/2533)
373
+ - [apache/lucene](https://github.com/apache/lucene/pull/15629)
372
374
  - [jcrist/msgspec](https://github.com/jcrist/msgspec/pull/918)
373
375
  - [python-humanize/humanize](https://github.com/python-humanize/humanize/pull/276)
374
376
  - [MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli/pull/535)
375
377
  - [simple-icons/simple-icons](https://github.com/simple-icons/simple-icons/pull/14245)
376
378
  - [ast-grep/ast-grep](https://github.com/ast-grep/ast-grep.github.io/commit/e30818144b2967a7f9172c8cf2f4596bba219bf5)
377
379
  - [commitizen-tools/commitizen](https://github.com/commitizen-tools/commitizen)
380
+ - [cocoindex-io/cocoindex](https://github.com/cocoindex-io/cocoindex/pull/1564)
381
+ - [cachix/devenv](https://github.com/cachix/devenv/pull/2304)
382
+ - [copper-project/copper-rs](https://github.com/copper-project/copper-rs/pull/783)
378
383
 
379
384
  <!-- --8<-- [end: why] -->
380
385
 
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@j178/prek",
26
- "version": "0.3.0"
26
+ "version": "0.3.2"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -515,5 +515,5 @@
515
515
  }
516
516
  },
517
517
  "requires": true,
518
- "version": "0.3.0"
518
+ "version": "0.3.2"
519
519
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/j178/prek/releases/download/v0.3.0",
2
+ "artifactDownloadUrl": "https://github.com/j178/prek/releases/download/v0.3.2",
3
3
  "author": "j178 <hi@j178.dev>",
4
4
  "bin": {
5
5
  "prek": "run-prek.js"
@@ -210,7 +210,7 @@
210
210
  "zipExt": ".tar.gz"
211
211
  }
212
212
  },
213
- "version": "0.3.0",
213
+ "version": "0.3.2",
214
214
  "volta": {
215
215
  "node": "18.14.1",
216
216
  "npm": "9.5.0"