@j178/prek 0.4.14 → 0.5.1

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,119 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ Released on 2026-09-01.
6
+
7
+ ### Enhancements
8
+
9
+ - Add `--hide-status <passed|failed|skipped>` for hook reports ([#2644](https://github.com/j178/prek/pull/2644))
10
+ - Add `prek init` for repository setup ([#2636](https://github.com/j178/prek/pull/2636))
11
+ - Apply hook `env` during environment creation ([#2650](https://github.com/j178/prek/pull/2650))
12
+ - Disable error snippets in `check-yaml` diagnostics ([#2664](https://github.com/j178/prek/pull/2664))
13
+ - Show hooks excluded by skip selectors ([#2645](https://github.com/j178/prek/pull/2645))
14
+ - Support Pixi for Conda environments ([#2667](https://github.com/j178/prek/pull/2667))
15
+ - Support `cargo-binstall` for Rust CLI dependencies ([#2658](https://github.com/j178/prek/pull/2658))
16
+ - Warn about unused keys in user settings ([#2665](https://github.com/j178/prek/pull/2665))
17
+
18
+ ### Bug fixes
19
+
20
+ - Reject unsupported YAML tags in check-yaml ([#2656](https://github.com/j178/prek/pull/2656))
21
+
22
+ ### Documentation
23
+
24
+ - Clarify local hook documentation ([#2640](https://github.com/j178/prek/pull/2640))
25
+ - Clarify pre-commit command compatibility ([#2635](https://github.com/j178/prek/pull/2635))
26
+ - Document automatic PR fixes with autofix.ci ([#2643](https://github.com/j178/prek/pull/2643))
27
+ - Document check-yaml unsafe support ([#2632](https://github.com/j178/prek/pull/2632))
28
+ - Improve setup and workflow documentation ([#2637](https://github.com/j178/prek/pull/2637))
29
+
30
+ ### Other changes
31
+
32
+ - Drop low-usage release targets ([#2651](https://github.com/j178/prek/pull/2651))
33
+ - Generate a prek manifest JSON schema ([#2648](https://github.com/j178/prek/pull/2648))
34
+
35
+ ### Contributors
36
+
37
+ - @j178
38
+
39
+ ## 0.5.0
40
+
41
+ Released on 2026-08-27.
42
+
43
+ ### Highlights
44
+
45
+ #### Choose where hook toolchains come from
46
+
47
+ `language_version` now accepts a source `preference` alongside the version
48
+ `request`, letting you control where prek looks for a compatible toolchain when
49
+ it creates a hook environment. Use `managed` (the default) or `system` to choose
50
+ which source prek tries first while still allowing fallback and downloads. Use
51
+ `only-managed` or `only-system` to require one source.
52
+
53
+ For example, this local Ruff hook requires a Python 3.12 toolchain managed by
54
+ prek:
55
+
56
+ ```yaml
57
+ repos:
58
+ - repo: local
59
+ hooks:
60
+ - id: ruff
61
+ name: ruff
62
+ language: python
63
+ entry: ruff check
64
+ additional_dependencies: [ruff]
65
+ language_version:
66
+ request: "3.12"
67
+ preference: only-managed
68
+ ```
69
+
70
+ With `only-managed`, prek reuses a compatible toolchain from its managed store
71
+ or downloads one when needed. It never falls back to Python from `PATH`, an OS
72
+ package manager, or a version manager, so toolchain selection does not depend on
73
+ the developer or CI machine's external environment.
74
+
75
+ Existing scalar values such as `language_version: "3.12"` continue to work. See
76
+ [toolchain management and `language_version`](https://prek.j178.dev/0.5.0/languages/#toolchain-management-and-language_version)
77
+ for the full source-selection behavior. ([#2613](https://github.com/j178/prek/pull/2613))
78
+
79
+ ### Breaking changes
80
+
81
+ The breaking changes in this release are mostly small cleanups, and most users should not be affected.
82
+
83
+ - Group names can no longer start with `@`. This prefix is now reserved for special group selectors such as the new `@ungrouped` selector. ([#2617](https://github.com/j178/prek/pull/2617))
84
+ - `PREK_MAX_CONCURRENCY` has been removed. Use `PREK_CONCURRENT_HOOKS` and `PREK_CONCURRENT_BATCHES` to control hook and per-hook batch concurrency separately. ([#2620](https://github.com/j178/prek/pull/2620))
85
+ - The top-level `prek init-template-dir` command has been removed. Use `prek util init-template-dir`, or `prek init-templatedir` for drop-in compatibility with `pre-commit`. ([#2623](https://github.com/j178/prek/pull/2623))
86
+ - `prek auto-update` has been removed. Use `prek update`, or `prek autoupdate` for drop-in compatibility with `pre-commit`. ([#2619](https://github.com/j178/prek/pull/2619))
87
+
88
+ ### Enhancements
89
+
90
+ - Add configurable toolchain source preferences ([#2613](https://github.com/j178/prek/pull/2613))
91
+ - Allow explicit `language: python` to opt out of fast-path hooks ([#2608](https://github.com/j178/prek/pull/2608))
92
+ - Group `run` and `update` options in CLI help ([#2629](https://github.com/j178/prek/pull/2629))
93
+ - Preserve terminal theme contrast for status labels ([#2592](https://github.com/j178/prek/pull/2592))
94
+ - Add `@ungrouped` group selector ([#2617](https://github.com/j178/prek/pull/2617))
95
+ - Retry uv installation with static musl binary ([#2600](https://github.com/j178/prek/pull/2600))
96
+ - Support `{hook_repo}` placeholder in hook `entry` ([#2602](https://github.com/j178/prek/pull/2602))
97
+
98
+ ### Bug fixes
99
+
100
+ - Expose the git work tree to hooks running outside the git root ([#2579](https://github.com/j178/prek/pull/2579))
101
+ - Isolate local hook environment installation ([#2615](https://github.com/j178/prek/pull/2615))
102
+ - Preserve hook config deserialization error locations ([#2573](https://github.com/j178/prek/pull/2573))
103
+ - Resolve hook log files from their config directory ([#2580](https://github.com/j178/prek/pull/2580))
104
+ - Track explicit config paths as absolute paths ([#2574](https://github.com/j178/prek/pull/2574))
105
+
106
+ ### Documentation
107
+
108
+ - Document prek run architecture ([#2630](https://github.com/j178/prek/pull/2630))
109
+ - Publish versioned documentation ([#2626](https://github.com/j178/prek/pull/2626))
110
+
111
+ ### Contributors
112
+
113
+ - @jeromeheissler
114
+ - @gurgeous
115
+ - @j178
116
+
3
117
  ## 0.4.14
4
118
 
5
119
  Released on 2026-08-17.
package/README.md CHANGED
@@ -59,7 +59,7 @@ On Linux and macOS:
59
59
  <!-- --8<-- [start: linux-standalone-install] -->
60
60
 
61
61
  ```bash
62
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.4.14/prek-installer.sh | sh
62
+ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.5.1/prek-installer.sh | sh
63
63
  ```
64
64
 
65
65
  <!-- --8<-- [end: linux-standalone-install] -->
@@ -69,7 +69,7 @@ On Windows:
69
69
  <!-- --8<-- [start: windows-standalone-install] -->
70
70
 
71
71
  ```powershell
72
- powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.4.14/prek-installer.ps1 | iex"
72
+ powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.5.1/prek-installer.ps1 | iex"
73
73
  ```
74
74
 
75
75
  <!-- --8<-- [end: windows-standalone-install] -->
@@ -152,7 +152,7 @@ cargo binstall prek
152
152
 
153
153
  <!-- --8<-- [start: cargo-install] -->
154
154
 
155
- Build from source using Cargo (Rust 1.95+ is required):
155
+ Build from source using Cargo (Rust 1.96+ is required):
156
156
 
157
157
  ```bash
158
158
  cargo install --locked prek
package/bin/prek.js CHANGED
@@ -76,22 +76,6 @@ function isMusl() {
76
76
  return false;
77
77
  }
78
78
 
79
- function armVersion() {
80
- const version = Number(process.config.variables.arm_version ?? 0);
81
- return Number.isFinite(version) ? version : 0;
82
- }
83
-
84
- function matchesArmVersion(spec) {
85
- const version = armVersion();
86
- if (spec.armVersionMin != null && version < spec.armVersionMin) {
87
- return false;
88
- }
89
- if (spec.armVersionMax != null && version > spec.armVersionMax) {
90
- return false;
91
- }
92
- return true;
93
- }
94
-
95
79
  function currentLibc() {
96
80
  if (process.platform !== "linux") {
97
81
  return null;
@@ -102,11 +86,10 @@ function currentLibc() {
102
86
  function pickPlatformPackage() {
103
87
  const libc = currentLibc();
104
88
  debug(
105
- `selecting package for platform=${process.platform} arch=${process.arch}` +
106
- `${libc ? ` libc=${libc}` : ""} armVersion=${armVersion()}`,
89
+ `selecting package for platform=${process.platform} arch=${process.arch}${libc ? ` libc=${libc}` : ""}`,
107
90
  );
108
91
 
109
- const candidates = PLATFORMS.filter((spec) => {
92
+ const candidate = PLATFORMS.find((spec) => {
110
93
  if (!spec.os.includes(process.platform)) {
111
94
  return false;
112
95
  }
@@ -116,24 +99,17 @@ function pickPlatformPackage() {
116
99
  if (spec.libc && spec.libc !== libc) {
117
100
  return false;
118
101
  }
119
- if (!matchesArmVersion(spec)) {
120
- return false;
121
- }
122
102
  return true;
123
- }).sort((left, right) => {
124
- const leftSpecificity = left.armVersionMin ?? 0;
125
- const rightSpecificity = right.armVersionMin ?? 0;
126
- return rightSpecificity - leftSpecificity;
127
103
  });
128
104
 
129
- if (candidates.length === 0) {
105
+ if (candidate == null) {
130
106
  const libcSuffix = libc ? ` (${libc})` : "";
131
107
  throw new Error(
132
108
  `Unsupported platform: ${process.platform} ${process.arch}${libcSuffix}`,
133
109
  );
134
110
  }
135
111
 
136
- return candidates[0];
112
+ return candidate;
137
113
  }
138
114
 
139
115
  function resolvePackageJson(packageName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@j178/prek",
3
- "version": "0.4.14",
3
+ "version": "0.5.1",
4
4
  "description": "A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,22 +26,14 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "optionalDependencies": {
29
- "@j178/prek-darwin-arm64": "0.4.14",
30
- "@j178/prek-darwin-x64": "0.4.14",
31
- "@j178/prek-linux-arm64-gnu": "0.4.14",
32
- "@j178/prek-linux-arm64-musl": "0.4.14",
33
- "@j178/prek-android-arm64": "0.4.14",
34
- "@j178/prek-linux-arm-gnueabihf": "0.4.14",
35
- "@j178/prek-linux-arm-musleabihf": "0.4.14",
36
- "@j178/prek-linux-armv7-musleabihf": "0.4.14",
37
- "@j178/prek-linux-ia32-gnu": "0.4.14",
38
- "@j178/prek-linux-ia32-musl": "0.4.14",
39
- "@j178/prek-linux-riscv64-gnu": "0.4.14",
40
- "@j178/prek-linux-s390x-gnu": "0.4.14",
41
- "@j178/prek-linux-x64-gnu": "0.4.14",
42
- "@j178/prek-linux-x64-musl": "0.4.14",
43
- "@j178/prek-win32-arm64-msvc": "0.4.14",
44
- "@j178/prek-win32-ia32-msvc": "0.4.14",
45
- "@j178/prek-win32-x64-msvc": "0.4.14"
29
+ "@j178/prek-darwin-arm64": "0.5.1",
30
+ "@j178/prek-darwin-x64": "0.5.1",
31
+ "@j178/prek-linux-arm64-gnu": "0.5.1",
32
+ "@j178/prek-linux-arm64-musl": "0.5.1",
33
+ "@j178/prek-android-arm64": "0.5.1",
34
+ "@j178/prek-linux-x64-gnu": "0.5.1",
35
+ "@j178/prek-linux-x64-musl": "0.5.1",
36
+ "@j178/prek-win32-arm64-msvc": "0.5.1",
37
+ "@j178/prek-win32-x64-msvc": "0.5.1"
46
38
  }
47
39
  }
package/platforms.json CHANGED
@@ -56,92 +56,6 @@
56
56
  "arm64"
57
57
  ]
58
58
  },
59
- {
60
- "rustTarget": "armv7-unknown-linux-gnueabihf",
61
- "packageName": "@j178/prek-linux-arm-gnueabihf",
62
- "binaryName": "prek",
63
- "os": [
64
- "linux"
65
- ],
66
- "cpu": [
67
- "arm"
68
- ],
69
- "libc": "glibc",
70
- "armVersionMin": 7
71
- },
72
- {
73
- "rustTarget": "arm-unknown-linux-musleabihf",
74
- "packageName": "@j178/prek-linux-arm-musleabihf",
75
- "binaryName": "prek",
76
- "os": [
77
- "linux"
78
- ],
79
- "cpu": [
80
- "arm"
81
- ],
82
- "libc": "musl"
83
- },
84
- {
85
- "rustTarget": "armv7-unknown-linux-musleabihf",
86
- "packageName": "@j178/prek-linux-armv7-musleabihf",
87
- "binaryName": "prek",
88
- "os": [
89
- "linux"
90
- ],
91
- "cpu": [
92
- "arm"
93
- ],
94
- "libc": "musl",
95
- "armVersionMin": 7
96
- },
97
- {
98
- "rustTarget": "i686-unknown-linux-gnu",
99
- "packageName": "@j178/prek-linux-ia32-gnu",
100
- "binaryName": "prek",
101
- "os": [
102
- "linux"
103
- ],
104
- "cpu": [
105
- "ia32"
106
- ],
107
- "libc": "glibc"
108
- },
109
- {
110
- "rustTarget": "i686-unknown-linux-musl",
111
- "packageName": "@j178/prek-linux-ia32-musl",
112
- "binaryName": "prek",
113
- "os": [
114
- "linux"
115
- ],
116
- "cpu": [
117
- "ia32"
118
- ],
119
- "libc": "musl"
120
- },
121
- {
122
- "rustTarget": "riscv64gc-unknown-linux-gnu",
123
- "packageName": "@j178/prek-linux-riscv64-gnu",
124
- "binaryName": "prek",
125
- "os": [
126
- "linux"
127
- ],
128
- "cpu": [
129
- "riscv64"
130
- ],
131
- "libc": "glibc"
132
- },
133
- {
134
- "rustTarget": "s390x-unknown-linux-gnu",
135
- "packageName": "@j178/prek-linux-s390x-gnu",
136
- "binaryName": "prek",
137
- "os": [
138
- "linux"
139
- ],
140
- "cpu": [
141
- "s390x"
142
- ],
143
- "libc": "glibc"
144
- },
145
59
  {
146
60
  "rustTarget": "x86_64-unknown-linux-gnu",
147
61
  "packageName": "@j178/prek-linux-x64-gnu",
@@ -177,17 +91,6 @@
177
91
  "arm64"
178
92
  ]
179
93
  },
180
- {
181
- "rustTarget": "i686-pc-windows-msvc",
182
- "packageName": "@j178/prek-win32-ia32-msvc",
183
- "binaryName": "prek.exe",
184
- "os": [
185
- "win32"
186
- ],
187
- "cpu": [
188
- "ia32"
189
- ]
190
- },
191
94
  {
192
95
  "rustTarget": "x86_64-pc-windows-msvc",
193
96
  "packageName": "@j178/prek-win32-x64-msvc",