-
Notifications
You must be signed in to change notification settings - Fork 168
feat(install): allow to install hook locally with husky #1150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1150 +/- ##
==========================================
- Coverage 91.97% 91.91% -0.06%
==========================================
Files 144 144
Lines 6202 6218 +16
==========================================
+ Hits 5704 5715 +11
- Misses 498 503 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return hooks_path | ||
|
|
||
|
|
||
| def get_local_hooks_path() -> Optional[Path]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having both get_local_hook_dir_path() and get_local_hooks_path() is confusing. Maybe name this one get_hooks_path_from_local_git_config() (a bit long, but unambiguous)?
| from tests.repository import Repository | ||
|
|
||
|
|
||
| def test_install_local_detects_husky(tmp_path: Path) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect a functional test to use Husky for real. Is it doable?
I think if you replace the use of run_ggshield() with a call to install_local() then this code can become a unit test for install_local().
Fixes #1143
Context
Trying to fix error #1143
What has been done
In case the git hooks path is the husky path, add the ggshield command in the husky configuration file
Validation
See issue
PR check list
skip-changeloglabel has been added to the PR.