-
Notifications
You must be signed in to change notification settings - Fork 919
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
Fix copyright check issues in pre-commit #11711
Fix copyright check issues in pre-commit #11711
Conversation
9428b4e
to
dabc04e
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-22.10 #11711 +/- ##
===============================================
Coverage ? 85.90%
===============================================
Files ? 151
Lines ? 23532
Branches ? 0
===============================================
Hits ? 20214
Misses ? 3318
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@vyasr @galipremsagar I tagged you both for review because of your experience with the copyright scripts and pre-commit. Thanks! |
While working on #11711, I noticed a set of files that did not have copyright headers in place. This PR fixes them. I used the "start year" from the output of `git log` indicating the first commit to each file. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) - Jordan Jacobelli (https://github.com/Ethyling) - Nghia Truong (https://github.com/ttnghia) URL: #11712
Once merged, could you also copy over the changes to |
Is this good to go? |
I’d like a final approval from @vyasr to make sure there wasn’t anything else he wanted to address. Then please feel free to merge! |
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.
I couldn't come up with a nice way to resolve the file vs git.Diff object issue, I think we just need to support both for now. Aside from that, this looks fine.
@gpucibot merge |
Description
This PR resolves #10323 and phases out the
gitutils.py
module in favor of a dependency on GitPython that is managed by pre-commit. It fixes the pre-commit check for copyright years so that only modifications between the target branch (branch-X.Y
) and the current git stage will trigger copyright changes (years will not be updated for unmodified files, or for changes that have not been staged). Additionally, it changes the return code to1
if changes are requested and applied (if modifications were required, that should be considered a failure).This is the last step to making our entire style check pipeline friendly to pre-commit.
Checklist