Skip to content
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

Merged
merged 27 commits into from
Sep 13, 2019
Merged

Add new mode autohooks config setting #24

merged 27 commits into from
Sep 13, 2019

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Apr 29, 2019

Checklist:

@codecov
Copy link

codecov bot commented Apr 29, 2019

Codecov Report

Merging #24 into master will increase coverage by 2.32%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
autohooks/config.py 98.03% <100%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54d0bb6...10b3938. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 29, 2019

Codecov Report

Merging #24 into master will increase coverage by 8.57%.
The diff coverage is 87.32%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
autohooks/cli/activate.py 0% <0%> (ø) ⬆️
autohooks/cli/check.py 0% <0%> (ø) ⬆️
autohooks/template.py 100% <100%> (ø)
autohooks/setting.py 100% <100%> (ø)
autohooks/config.py 97.95% <100%> (+0.59%) ⬆️
autohooks/install.py 64.86% <78.57%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c49fdc5...96cafaf. Read the comment docs.

bjoernricks and others added 24 commits August 30, 2019 19:44
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.
@bjoernricks bjoernricks added the enhancement New feature or request label Sep 7, 2019
In the Enum class name is actually a method but is gets converted to
some metaclass magic.
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
bjoernricks and others added 2 commits September 12, 2019 15:35
Co-Authored-By: Michael Wiegand <wiegandm@users.noreply.github.com>
@bjoernricks bjoernricks merged commit 181ccf9 into greenbone:master Sep 13, 2019
@bjoernricks bjoernricks deleted the config-mode branch September 13, 2019 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants