Replies: 1 comment
|
Thanks, make sense to me. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Please add a hook-level
--checkargument to the builtin hooks without a read-only mode, enabling CI and local validation without applying changes.Scope
Add
--checkto these five hooks:trailing-whitespace(Trims trailing whitespace.)end-of-file-fixer(Ensures files are empty or end with exactly one newline.)file-contents-sorter(Sorts lines in specified files.)requirements-txt-fixer(Sorts entries in requirements.txt.)fix-byte-order-marker(Removes a UTF-8 byte order marker.)Exclude hooks with existing read-only modes:
pretty-format-json(Checks without modifying files when--autofixis omitted.)mixed-line-ending(Checks without modifying files with--fix=no.)All other built-in hooks are read-only and remain unchanged.
Behavior
--check, evaluate fixes using the configured options and only read access, without changing workspace state, even temporarily.--checkis omitted.Usage
Example
.pre-commit-config.yamlcombining the new flag with existing read-only modes:$ prek run --all-filesAll reactions