-
Notifications
You must be signed in to change notification settings - Fork 416
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
chore: add pre-commit hooks #2324
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2324 +/- ##
=======================================
Coverage 91.22% 91.22%
=======================================
Files 573 573
Lines 41239 41256 +17
=======================================
+ Hits 37621 37637 +16
- Misses 3618 3619 +1
Continue to review full report at Codecov.
|
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.
👍 any reason for not including isort?
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.
🙌 can't wait to install these!
What's the rationale for using a bash script rather than the |
@jd |
Description
In order to automate linting and formatting tools including
black
,flake8
,, andisort
mypy
and pre-commit tools including EOF and whitespace trimming and YAML file checking, a pre-commit hook configuration was set up.This was initially done with the
pre-commit
package, but it did not allow synchronization with our riot tool versions. Thus, we moved to usingautohook
which is a simple shell script that runs our riot commands and lets us avoid having to maintain additional versions.Note: in order to use these pre-commit hooks, the following command must be run once beforehand:
pre-commit install
hooks/autohook.sh install
. This has been addressed by adding the riot commandriot run pre-commit
riot run autohook
which can be run once and installs thepre-commit
autohook
pre-commit script and initializes the riot hooks to be run ongit commit
commands.