-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add new mode autohooks config setting #24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 31.09% 33.41% +2.32%
==========================================
Files 10 10
Lines 373 386 +13
==========================================
+ Hits 116 129 +13
Misses 257 257
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 31.09% 39.67% +8.57%
==========================================
Files 10 12 +2
Lines 373 431 +58
==========================================
+ Hits 116 171 +55
- Misses 257 260 +3
Continue to review full report at Codecov.
|
Use real template for pre-commit hook to add a shebang line corresponding to the desired mode. This will allow to execute autohooks directly from a pipenv if available.
* Add Mode MANUAL * Provide an get_effective_mode method (UNDEFINED and UNKNOWN are only for user input not for the applicable mode) * Write tests
Allow to check a path if it contains a autohooks precommit hook.
Fail hook execution if autohooks is not installed. The user still can ignore autohooks with git commit --no-verify. References #25
Running env with several params requires the -S argument. Also because authooks only supports python 3 we should require running the python3 executable within the env. It may be possible that both python versions are installed in the env.
The user has to add autohooks to the PYTHON_PATH manually. Therefore PYTHONPATH seems to be the better name.
The pre-commit hook script file needs to be executable for the user. Default is 0x775 for the sample files. Thus use the same permissions the installed hook.
For setting the mode not only from the config it must be passed via an argument during template creation.
When running autohooks activate print the used mode.
When running autohooks activate allow to set the mode.
Drop section of proposed workflow. With the autohooks mode this has become obsolete. Update installation procedure to configure settings before the activation. activate will raise a warning if the pyproject.toml settings aren't available. It is also better to specify the desired mode first.
In the Enum class name is actually a method but is gets converted to some metaclass magic.
Co-Authored-By: Michael Wiegand <[email protected]>
Checklist: