-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Black Format Codebase #251
Conversation
This commit formats all .py files in the codebase with the black formatter python package, as well as adds the black package to the environment.yml file. Issue princeton-nlp#195 Black Format Codebase
This commit adds a file to ignore the initial black formatting of the entire codebase via gitblame. Since it was an extremely large commit, it could clutter the working tree/blamelog, so this supplies the option and instructions to ignore the specific commit when developing Issue princeton-nlp#195 Black Format Codebase
@klieret Here's another one, an attempt at sensibly introducing black formatting to the repository both retroactively and forwardly as a pre-commit hook. Let me know what you think! |
eff7694
to
bc275d3
Compare
This commit adds the black formatter as a pre-commit hook to the repository Issue princeton-nlp#195 Black Format Codebase
bc275d3
to
bc53810
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #251 +/- ##
==========================================
- Coverage 72.88% 72.86% -0.03%
==========================================
Files 17 17
Lines 2545 2543 -2
==========================================
- Hits 1855 1853 -2
Misses 690 690 ☔ View full report in Codecov by Sentry. |
Hi sorry @hminsky2002 , but I had assigned this issue to myself because I need to talk with the team again about this first. Also, such a PR will almost certainly merge conflict if not directly merged, so I'll have to close it (as it is more time to keep this updated). Again sorry for the work you already put in this! |
@klieret No sweat! Was a neat experience working with pre-commit hooks, and I should've checked to see if there were any current assignees(duh). |
Reference Issues/PRs
Fixes #195
What does this implement/fix? Explain your changes.
This large commit introduces black formatting to the codebase, as well as adding black formatting as a pre-commit hook. Furthermore, it introduces an ignoreRev file that can be used to locally configure your git to ignore the revisions made in the extremely large reformatting commit when looking at blame logs.
Files Formatted:
All
.py
filesFiles added:
.git-blame-ignore-revs
Files Modified:
.pre-commit-config.yaml
Any other comments?
This is understandably a huge PR, more just implemented as a jumping off point, there may be specific black configurations that would be more desirable. Happy to refactor/reedit, or just leave as an example!
🧡 Thanks for contributing!