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 pre-commit as optional developer tool #1671

Merged
merged 3 commits into from
Mar 21, 2022

Conversation

dbluhm
Copy link
Member

@dbluhm dbluhm commented Mar 17, 2022

This PR adds pre-commit and associated configuration. This is more or less a tool for installing git hooks that check flake8 and black before committing. When used, this helps prevent follow up commits for formatting changes with black or correcting complaints from flake8.

There is also a configuration for installing hooks for checking that the commit message conforms to conventional commits.

It is possible to use the pre-commit hooks (flake8 and black) without the commit-msg hooks (commitlint) and vice-versa. Contributors can also ignore pre-commit altogether -- this is purely opt-in and must be explicitly installed.

Pre-commit is a pretty widely used tool in the python community and is analogous to husky in the javascript community. I've had these configuration files hanging out in my local fork of the ACA-Py repo and have been happily using them for more than a year.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@swcurran swcurran requested a review from ianco March 17, 2022 16:49
@codecov-commenter
Copy link

Codecov Report

Merging #1671 (3812a8e) into main (3774e85) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1671   +/-   ##
=======================================
  Coverage   95.50%   95.50%           
=======================================
  Files         528      528           
  Lines       32766    32766           
=======================================
  Hits        31293    31293           
  Misses       1473     1473           

@andrewwhitehead andrewwhitehead merged commit 1697569 into hyperledger:main Mar 21, 2022
@dbluhm dbluhm deleted the chore/pre-commit branch September 17, 2022 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants