1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Commit Graph

1167 Commits

Author SHA1 Message Date
Jules Tamagnan 1ea64fcb4a Support refs to trees (#1449)
* Support refs to trees

* Add test

* Add fallback

* style

* fixup
2026-01-22 11:00:12 +08:00
Shaan Majid 41e2b73246 test: add integration tests for hook skip behavior (#1428)
Add integration tests verifying that prek correctly identifies and
reports skipped hooks in various scenarios.

Tests cover:
- All hooks skipped due to no matching files
- Dry run mode skipping all hooks
- Mixed scenarios with both executed and skipped hooks
- Skipped hooks across multiple priority groups

Includes regression test for #1335: verifies that `git diff` is only
called once (initial baseline) when all hooks skip, not once per
priority group. Uses tracing output to count `get_diff` calls.

Refs: #1327, #1335
2026-01-22 10:46:34 +08:00
Shaan Majid f5262b6b2c docs: fix HTML anchors, grammar, capitalization, and add missing tracking issues (#1448) 2026-01-22 02:06:13 +08:00
jmm 5400299a4d Add pronounciation entry to FAQ. (#1442) 2026-01-22 00:00:44 +08:00
Jo edcf3d82ab Add taplo-fmt prek hook to format toml files (#1435) 2026-01-21 14:52:53 +08:00
tison e8279e5d86 Bump mea to 0.6.3 to reduce key clone in OnceMap (#1434)
Signed-off-by: tison <wander4096@gmail.com>
2026-01-21 14:20:55 +08:00
tison c8091b298f Migrate from uv-once-map to mea OnceMap (#1433)
Signed-off-by: tison <wander4096@gmail.com>
2026-01-21 13:57:20 +08:00
Jo 4dfb3fd830 Improve JSON schema for repo field (#1432) 2026-01-21 11:45:39 +08:00
Jo 23b4456a80 Expand ~ tilde in PREK_HOME (#1431) 2026-01-21 11:35:52 +08:00
Jo c0bcc788de Improve generated JSON schema for builtin and meta hooks (#1427)
* Improve generated JSON schema for builtin and meta hooks

* Improve JSON schema for builtin and meta hooks
2026-01-21 01:08:17 +08:00
Jo ccc8f92ca7 Remove mkdocs hooks (#1424) 2026-01-20 19:50:07 +08:00
Kevin Gimbel 88c3c87954 Move docs to zensical (#1421)
* chore: slight formatting adjustments

* feat: use zensical

* chore: add uv to mise.toml

* docs: update snippets and snippet markers for includes

* chore: add prek to mise.toml; run prek

* fix: use snippet for changelog instead of symlink

Seems Zensical doesn't like symlinks, a snippet gets the same result

* chore: remove commented-out code

* chore: remove commented-out code; run prek
2026-01-20 19:44:15 +08:00
Matthias Schoettle 0784ddfaea Add mdformat pre-commit hook (#1416) 2026-01-20 11:26:37 +08:00
Jo d6088e18e9 Delete SECURITY.md 2026-01-20 06:56:07 +08:00
Shaan Majid dcf2c5aff1 Use split() instead of resolve(None) for builtin hook argument parsing (#1415)
* fix: use split() instead of resolve(None) for builtin hook argument parsing

Builtin hooks were calling `hook.entry.resolve(None)` to get arguments
for clap parsing. After commit 85448ac, `resolve(None)` falls back to
system PATH, which can find system-wide binaries (e.g., from
`pip install pre-commit-hooks`), parse their shebangs, and corrupt
argument parsing.

The fix changes these 6 builtin hooks to use `split()` instead, which
just tokenizes the entry string without PATH resolution - exactly what's
needed for argument parsing.

Fixes #1412

* test: add regression test for builtin hooks with system PATH binaries

Adds a test that verifies builtin hooks work correctly even when
system-wide binaries with matching names exist on PATH (e.g., from
`pip install pre-commit-hooks`).

The test creates a fake `trailing-whitespace-fixer` binary with a
shebang in a temp directory, adds it to PATH, and verifies the builtin
trailing-whitespace hook still works correctly.
2026-01-20 05:27:26 +08:00
Yazdan Ranjbar f32d29236c Add commitizen to the list of projects using prek (#1413) 2026-01-20 05:14:03 +08:00
Matthias Schoettle a01951d129 Fix nested list indent rendering issue (#1414) 2026-01-20 05:09:57 +08:00
Jo f1b110c0a8 Add tests for yaml::merge_keys (#1409) 2026-01-19 18:47:27 +08:00
Jo 1988af24b3 Add two test cases for unknown hook id (#1408) 2026-01-19 18:09:41 +08:00
Jo 63a9c5c8f8 Refactor config layout (#1407)
* Refactor config layout

* Fix

* Add a test

* Tweak
2026-01-19 17:54:01 +08:00
Jo e9716ae31b Avoid file lock warning for in-process contention (#1406)
* .

* Avoid file lock warning for in-process contention
2026-01-19 15:00:51 +08:00
Jo 19b9c866bf Update project examples in README.md 2026-01-19 14:01:52 +08:00
Jo ea9a51161c Set cargo related env vars (#1405) 2026-01-19 13:41:43 +08:00
Jo dfbea266fd Remove #[cfg(unix)] gate on generating cli reference (#1402)
* Remove `#[cfg(unix)]` gate on generating cli reference

* Tweak

* Debug

* Debug

* Normalized eol

* Debug

* Add gitattributes

* Final
2026-01-19 13:37:34 +08:00
Jo 97e5b348f1 Add copilot instructions (#1404) 2026-01-19 13:17:51 +08:00
Jo 3d562b4f49 Add simple-icons and ast-grep to the users of prek (#1403) 2026-01-19 11:30:33 +08:00
Jo ac1b1d4202 Add --stage as an alias for --hook-stage (#1398) 2026-01-18 22:37:42 +08:00
Ülgen Sarıkavak 37d6c10fd1 Update deprecated key (#1397)
> matchPaths and matchFiles are now combined into matchFileNames, supporting exact match and glob-only. The "any string match" functionality of matchPaths is now removed

https://github.com/renovatebot/renovate/releases/tag/36.0.0
2026-01-18 21:36:01 +08:00
Ülgen Sarıkavak 7c8cdf7e5e Enable Renovate's ":configMigration" preset (#1394)
Found that the config needs to be migrated, while testing https://github.com/renovatebot/pre-commit-hooks
2026-01-18 21:11:31 +08:00
Jo 6f53870934 Fix docker build command (#1395) v0.2.30 2026-01-18 21:09:35 +08:00
Jo 300cae9d55 Fix docker build command (#1393) 2026-01-18 21:00:16 +08:00
Jo de647489ea Bump version to 0.2.30 (#1392) 2026-01-18 20:49:58 +08:00
Jo 8faa42c091 Add nextest partitioning for Windows tests (#1389)
* Add nextest partitioning for Windows tests

* Fix

* Fix

* Fix

* Fix

* Disable optimize for fast-build

* Fix integration bin name

* Fix

* Fix

* Try fix

* Debug

* Fix

* Fix path substitute

* Fix
2026-01-18 20:37:53 +08:00
Jo b7b453d500 Document that check-json5 now rejects duplicate keys (#1391) 2026-01-18 17:01:09 +08:00
Jo c67ac0ea29 Make CURRENT_REPORTER a Weak<ProgressReporter> (#1390) 2026-01-18 16:58:08 +08:00
Jo 4a8b58b7a7 Show warning if file lock acquiring blocks for long time (#1353)
* Show a lock acquire warning if it blocks

* Improve

* Add test
2026-01-18 16:24:45 +08:00
Jo 845d849719 Speed up reuse_env test case (#1388)
Replace `flake8` with a local package to reduce install time.
2026-01-18 14:53:39 +08:00
Jo a58828ca4c Check for duplicate keys in check-json5 builtin hook (#1387) 2026-01-18 14:27:07 +08:00
Jo 0e934c383c Do not resolve entry for docker_image (#1386) 2026-01-18 14:04:39 +08:00
Jo 85448ac471 Fix command lookup on Windows (#1383)
* Add a failing test

* Fix

* Docker entry should not be resolved
2026-01-17 22:53:13 +08:00
Jo 414d0cc088 Singleflight Python health checks with cached interpreter info (#1381) 2026-01-17 19:08:02 +08:00
Jo 52c20ab065 Document language support details (#1380) 2026-01-17 17:48:11 +08:00
Jo 340a773f90 Preserve quoting style in auto-update (#1379) 2026-01-17 17:28:18 +08:00
Jo 56180f3d29 Build binaries using minimal-size profile (#1376) 2026-01-16 21:14:38 +08:00
Jo 8c2580a12b Fix callout indentation (#1375) 2026-01-16 21:07:48 +08:00
Jo b7a7becead Bump version to 0.2.29 (#1374) v0.2.29 2026-01-16 19:28:25 +08:00
Jo f6731ad435 Explain project configuration scope (#1373) 2026-01-16 19:09:44 +08:00
Jo 163c910f6f Use #[serde(try_from)] instead of custom Deserialize (#1372)
* Use `#[serde(try_from)]` instead of custom Deserialize

* Update schema
2026-01-16 18:37:04 +08:00
Jo 724b2a5719 Use GlobSet instead of Vec<GlobMatcher> (#1371) 2026-01-16 17:18:08 +08:00
Na'aman Hirschfeld 392eb2d60c Add glob list support for file patterns (files and exclude) (#1197)
* feat: add glob list support for file patterns

# Conflicts:
#	docs/configuration.md

* Fix clippy warnings in config tests

* Add tests for glob file patterns

* chore: run cargo fmt

* test: make glob pattern test windows-friendly

* Fix CI: add globset dep and disable GPG signing in tests

* Update json schema

* Tweaks

* Update doc

* Update doc

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-01-16 16:59:26 +08:00