Repository navigation
Track pre-commit hooks as Poetry dependencies - #397
Merged
Merged
Conversation
cjolowicz
marked this pull request as draft
June 13, 2020 18:05
cjolowicz
force-pushed
the
pre-commit-poetry-nox
branch
from
July 3, 2020 10:11
6da3199 to
2f1417d
Compare
cjolowicz
marked this pull request as ready for review
July 8, 2020 12:35
Owner
Author
|
@paw-lu Any thoughts on this? |
added 19 commits
July 8, 2020 14:42
cjolowicz
force-pushed
the
pre-commit-poetry-nox
branch
from
July 8, 2020 12:44
ed0de9f to
6269a20
Compare
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.
This PR changes the way pre-commit is integrated with projects. Python-language hooks are no longer managed by pre-commit. Instead, they are tracked as development dependencies in Poetry, and installed into the Nox session alongside pre-commit itself. As development dependencies, they are also present in the Poetry environment.
In detail, this includes the following changes:
¹ Repository-local hooks are not backed by an external git repository.
² System hooks are not installed into a pre-commit environment.
This approach has some advantages:
pre-commit autoupdatedoes not include additional dependencies.There are also some drawbacks to this technique:
pyproject.tomlandnoxfile.py, and adding the hook definition topre-commit-config.yaml.See #316