1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Files
prek/docs
Jo 90046cee4f Check and sync frozen comments during auto-update (#1896)
## Summary

`auto-update` now validates existing `# frozen:` comments against the
commit pinned in `rev`.

If the frozen comment is stale:
- in normal update mode, `auto-update` updates it to a matching ref when
possible, or removes it if no ref points to the pinned commit
- in `--dry-run`, it only reports the mismatch and does not modify the
config file
- in `--check`, it behaves like `--dry-run` and exits with status 1 if
updates would be made

This keeps frozen comments consistent with pinned SHA revisions without
adding a separate command.

## Example
```console
❯ cargo run -- auto-update --check                                                                                                                                                                                                                                                                                        
warning: [https://github.com/crate-ci/typos] frozen ref `v1.0` does not match `1111111111111111111111111111111111111111`
  --> .pre-commit-config.yaml:18:63
   |
18 |     rev: '1111111111111111111111111111111111111111' # frozen: v1.0
   |                                                               ^^^^ `v1.0` could not be resolved
   |
   = note: pinned commit `1111111111111111111111111111111111111111` does not exist in the repo
```
Closes #1864
2026-04-08 16:24:56 +08:00
..
2026-01-20 19:44:15 +08:00
2026-03-23 16:08:10 +08:00