-
Notifications
You must be signed in to change notification settings - Fork 170
Add auto-formatters as pre-commit hooks #147
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
Conversation
|
Locally all tests also pass after applying the auto-formatting, so this PR should be good to go as soon as the configs are approved. |
ejguan
left a comment
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.
This is amazing. Thank you so much. And, sorry for the late response, I was out of office,
|
LMK after you push all the needed changes, then I will import and land. Thanks a lot. |
|
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ejguan
left a comment
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.
Thank you so much. Have a super nit: Can you add several words in CONTRIBUTING.md as the PR summary to help others understand how it works?
|
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This adds a couple of
pre-commithooks for auto-formatting files in the repository. The include mainlyblackandusortthat are run throughufmtand are fully compatible with Meta internal workflows. In addition,flake8can also be run through this framework.To install the hooks
pip install pre-commit firstand afterwards runpre-commit installinside the repository. Now, every time yougit commitsomething, these hooks will run and make sure the code format is correct. You can also invoke them manually withpre-commit run, which will check all staged files.For now I only included the configuration files. If they are approved, I'll pull the trigger and push all changes that need to be made to the repository to be compatible with the format.