A small release that adds a new fail_on_fix hook option for workflows that want fixes applied but commits blocked, along with correctness improvements to several built-in linter configurations.
Added
-
fail_on_fixhook option: Hooks can now setfail_on_fix = trueto fail when fix commands actually modify files. This is designed forstage = falsepre-commit workflows where you want fixers to apply changes but block the commit so you can review and stage them manually. Defaults tofalseto preserve existing behavior. (@jdx) #725hooks { ["pre-commit"] { fix = true stage = false fail_on_fix = true steps = linters } }
Fixed
- Cleaner builtin linter configs: Removed redundant
checkcommands fromblack,ruff_format, andtaplo_formatbuiltins wherecheck_diffalready covers all issues. Removedcheck_difffrom theruffbuiltin becauseruff check --diffcan exit 0 even when non-fixable issues exist, which caused hk to incorrectly skip the fix step. Thanks @nkakouros! #726
Full Changelog: v1.37.0...v1.38.0