Add --no-hook flag to all usethis tool subcommands#1558
Merged
nathanjmcdougall merged 11 commits intomainfrom Mar 27, 2026
Merged
Add --no-hook flag to all usethis tool subcommands#1558nathanjmcdougall merged 11 commits intomainfrom
--no-hook flag to all usethis tool subcommands#1558nathanjmcdougall merged 11 commits intomainfrom
Conversation
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/6b5576e1-3848-496b-838f-646d2976a563
- Add no_hook_opt shared option in options.py - Add --no-hook parameter to all 12 tool commands in tool.py - Pass no_hook through to usethis_config.set(disable_pre_commit=no_hook) - Add disable_pre_commit check to remove_pre_commit_repo_configs() in base.py - Update docs/cli/reference.md with the new flag - Add tests for --no-hook with add/remove scenarios Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/6b5576e1-3848-496b-838f-646d2976a563
- Move get_hook_ids import to top-level in test file - Add assertion that ruff config was actually applied when using --no-hook Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/6b5576e1-3848-496b-838f-646d2976a563
Copilot
AI
changed the title
[WIP] Add
Add Mar 26, 2026
--no-hook flag for all tools in usethis--no-hook flag to all usethis tool subcommands
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will degrade performance by 8.36%
Performance Changes
Comparing |
nathanjmcdougall
requested changes
Mar 26, 2026
Consolidate tests from the standalone TestNoHook class into their respective tool test classes for better organization. Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/bdf911da-fd3b-4192-bb4b-305306de2fd1 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
…m/usethis-python/usethis-python into copilot/add-no-hook-flag-to-tools
nathanjmcdougall
approved these changes
Mar 27, 2026
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.
no_hook_optshared option tosrc/usethis/_ui/options.py--no-hookflag to all tool commands insrc/usethis/_ui/interface/tool.pydisable_pre_commitcheck toremove_pre_commit_repo_configs()insrc/usethis/_tool/base.pydocs/cli/reference.mdto document the new--no-hookflag--no-hookflag (consolidated intoTestCodespellandTestRuffclasses)Original prompt
--no-hookflag for all tools #590⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.