Document hook_types flag and default_install_hook_types behavior#1225
Merged
Document hook_types flag and default_install_hook_types behavior#1225
Conversation
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix post-commit hook generation in prek
Document hook_types flag and default_install_hook_types behavior
Dec 14, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1225 +/- ##
=======================================
Coverage 89.81% 89.81%
=======================================
Files 79 79
Lines 15274 15274
=======================================
Hits 13718 13718
Misses 1556 1556 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
--hook-type/-tflag was undocumented, causing confusion about the difference between a hook'sstagesparameter (which stages a hook can run in) and--hook-type(which stages to actually install hooks for).Changes
Added documentation to
hook_typesfield in three structs:InstallArgs: Clarifies that--hook-typespecifies which git hook stages to install, defaults todefault_install_hook_typesfrom config orpre-commitUninstallArgs: Same default behavior as install (was incorrectly assumed to uninstall all hook types)InitTemplateDirArgs: Expanded minimal docs to match the other twoAll three now explicitly mention:
stagesparameter in configdefault_install_hook_typesconfig optionpre-commitfallback defaultGenerated CLI reference documentation updated automatically via the existing test infrastructure.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
mirrors.aliyun.com/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install-hooks 7b012f.0lcsp62g3/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so 7b012f.0uunehm2k-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper 7b01�� 7b012f.1thssvl7e--build-id 31e55646.0fnjq53--eh-frame-hdr 31e55646.0nkfynl-m 31e55646.0vpsks4bash 31e55646.0xn5yzf--norc 31e55646.13a4tkb--noprofile 31e55646.14zf254-dynamic-linker 31e5�� 31e55646.193qbus-pie 31e55646.1hruvxh-z 31e55646.1o4qxbqnow 31e55646.1oq6syn/usr/bin/git 31e55646.1re00to-c 31e55646.1ta1m7bcore.useBuiltinFSMonitor=false 31e55646.22ezco7rev-parse(dns block)/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install-hooks --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -fuse-ld=lld -z relro -o 3936�� ck6esr3x5olrhxooh9.0ugdsqx.rcgu.o w41wn4zm6cfbdux46l.0ugdsqx.rcgu.o b/rustlib/x86_64-m b/rustlib/x86_64/home/REDACTED/.rustup/toolchains/1.91-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld b/rustlib/x86_64-plugin b/rustlib/x86_64/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so b/rustlib/x86_64-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper(dns block)/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install --install-hooks /home/REDACTED/work/prek/prek/target/debug/deps/auto_update-a359c9e39a37bed6 2lal�� own-linux-gnu/li/home/REDACTED/work/prek/prek/target/debug/deps/run-2042b33f0bbabeab.0cq0op0yf8m9ucc 0f3.087odwibys7b/home/REDACTED/work/prek/prek/target/debug/deps/run-2042b33f0bbabeab.0d8in8zt992r8-m64 b/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld 0f3.11cxv1yq5399/home/REDACTED/.rustup/toolchains/1.91-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64/home/REDACTED/work/prek/prek/target/debug/deps/prek_pty-972eca60d2b6ee1d.5a0d272pxrfxpbyxibukkevjd.0h1zbzo.rcgu.o 0f3.1eaizeavdub9-flavor 0f3.289mu25m6xccgnu b/rustlib/x86_64-plugin 0f3.�� 0f3.2f2fidinkdyi-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper 0f3.2hfveram42x2-plugin-opt=-fresolution=/tmp/ccdqy5QF.res 9be2e3dd6baf 0f3.2pv1443p4o2hbash 0f3.2s0yxl86sgf4--norc 0f3.39u1hvx4cb6v--noprofile 9be2e3dd6baf(dns block)mirrors.cloud.tencent.com/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install-hooks 7b012f.0lcsp62g3/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so 7b012f.0uunehm2k-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper 7b01�� 7b012f.1thssvl7e--build-id 31e55646.0fnjq53--eh-frame-hdr 31e55646.0nkfynl-m 31e55646.0vpsks4bash 31e55646.0xn5yzf--norc 31e55646.13a4tkb--noprofile 31e55646.14zf254-dynamic-linker 31e5�� 31e55646.193qbus-pie 31e55646.1hruvxh-z 31e55646.1o4qxbqnow 31e55646.1oq6syn/usr/bin/git 31e55646.1re00to-c 31e55646.1ta1m7bcore.useBuiltinFSMonitor=false 31e55646.22ezco7rev-parse(dns block)/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install-hooks --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -fuse-ld=lld -z relro -o 3936�� ck6esr3x5olrhxooh9.0ugdsqx.rcgu.o w41wn4zm6cfbdux46l.0ugdsqx.rcgu.o b/rustlib/x86_64-m b/rustlib/x86_64/home/REDACTED/.rustup/toolchains/1.91-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld b/rustlib/x86_64-plugin b/rustlib/x86_64/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so b/rustlib/x86_64-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper(dns block)/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install --install-hooks /home/REDACTED/work/prek/prek/target/debug/deps/auto_update-a359c9e39a37bed6 2lal�� own-linux-gnu/li/home/REDACTED/work/prek/prek/target/debug/deps/run-2042b33f0bbabeab.0cq0op0yf8m9ucc 0f3.087odwibys7b/home/REDACTED/work/prek/prek/target/debug/deps/run-2042b33f0bbabeab.0d8in8zt992r8-m64 b/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld 0f3.11cxv1yq5399/home/REDACTED/.rustup/toolchains/1.91-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64/home/REDACTED/work/prek/prek/target/debug/deps/prek_pty-972eca60d2b6ee1d.5a0d272pxrfxpbyxibukkevjd.0h1zbzo.rcgu.o 0f3.1eaizeavdub9-flavor 0f3.289mu25m6xccgnu b/rustlib/x86_64-plugin 0f3.�� 0f3.2f2fidinkdyi-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper 0f3.2hfveram42x2-plugin-opt=-fresolution=/tmp/ccdqy5QF.res 9be2e3dd6baf 0f3.2pv1443p4o2hbash 0f3.2s0yxl86sgf4--norc 0f3.39u1hvx4cb6v--noprofile 9be2e3dd6baf(dns block)pypi.tuna.tsinghua.edu.cn/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install-hooks 7b012f.0lcsp62g3/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so 7b012f.0uunehm2k-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper 7b01�� 7b012f.1thssvl7e--build-id 31e55646.0fnjq53--eh-frame-hdr 31e55646.0nkfynl-m 31e55646.0vpsks4bash 31e55646.0xn5yzf--norc 31e55646.13a4tkb--noprofile 31e55646.14zf254-dynamic-linker 31e5�� 31e55646.193qbus-pie 31e55646.1hruvxh-z 31e55646.1o4qxbqnow 31e55646.1oq6syn/usr/bin/git 31e55646.1re00to-c 31e55646.1ta1m7bcore.useBuiltinFSMonitor=false 31e55646.22ezco7rev-parse(dns block)/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install-hooks --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -fuse-ld=lld -z relro -o 3936�� ck6esr3x5olrhxooh9.0ugdsqx.rcgu.o w41wn4zm6cfbdux46l.0ugdsqx.rcgu.o b/rustlib/x86_64-m b/rustlib/x86_64/home/REDACTED/.rustup/toolchains/1.91-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld b/rustlib/x86_64-plugin b/rustlib/x86_64/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so b/rustlib/x86_64-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper(dns block)/home/REDACTED/work/prek/prek/target/debug/prek /home/REDACTED/work/prek/prek/target/debug/prek install --install-hooks /home/REDACTED/work/prek/prek/target/debug/deps/auto_update-a359c9e39a37bed6 2lal�� own-linux-gnu/li/home/REDACTED/work/prek/prek/target/debug/deps/run-2042b33f0bbabeab.0cq0op0yf8m9ucc 0f3.087odwibys7b/home/REDACTED/work/prek/prek/target/debug/deps/run-2042b33f0bbabeab.0d8in8zt992r8-m64 b/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld 0f3.11cxv1yq5399/home/REDACTED/.rustup/toolchains/1.91-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64/home/REDACTED/work/prek/prek/target/debug/deps/prek_pty-972eca60d2b6ee1d.5a0d272pxrfxpbyxibukkevjd.0h1zbzo.rcgu.o 0f3.1eaizeavdub9-flavor 0f3.289mu25m6xccgnu b/rustlib/x86_64-plugin 0f3.�� 0f3.2f2fidinkdyi-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper 0f3.2hfveram42x2-plugin-opt=-fresolution=/tmp/ccdqy5QF.res 9be2e3dd6baf 0f3.2pv1443p4o2hbash 0f3.2s0yxl86sgf4--norc 0f3.39u1hvx4cb6v--noprofile 9be2e3dd6baf(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.