-
Notifications
You must be signed in to change notification settings - Fork 871
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 hooks for linting #2177
Conversation
gsheni
commented
Jul 11, 2022
•
edited
Loading
edited
- This makes it so that linting is automatically run right before you commit code:
- We use this https://pre-commit.com/
- Example of this:
@sbadithe Can checkout this branch and make sure the steps in
|
Commands run for me, but it skips all the checks as it says there are no files to check |
@sbadithe Yes, it will only run on the changed files |
contributing.md
Outdated
* Before you commit, a few lint fixing hooks will run. You can also manually run these. | ||
```bash | ||
pip install pre-commit | ||
pre-commit install |
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.
Do we need to list the pip install pre-commit
and pre-commit install
commands or will that be covered when users run make installdeps
?
I created a fresh environment and just ran make installdeps
and it seems like everything worked.
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.
Hmm...upon further review, you might actually have to run pre-commit install
before the hooks actually run on a commit on a fresh clone of the repo.
Maybe we also need to add pre-commit install
to the make installdeps
command?
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.
Fixed:
de40da2
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.
LGTM