-
Notifications
You must be signed in to change notification settings - Fork 431
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
Run local verifying targets too before git commit #3724
Run local verifying targets too before git commit #3724
Conversation
We are waiting on two PRs to merge before merging this PR. |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #3724 +/- ##
==========================================
+ Coverage 54.09% 54.86% +0.76%
==========================================
Files 186 188 +2
Lines 18849 19348 +499
==========================================
+ Hits 10197 10615 +418
- Misses 8105 8151 +46
- Partials 547 582 +35 ☔ View full report in Codecov by Sentry. |
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.
Interesting change! I had a couple things to clarify:
- Would adding these targets slow down the git commit workflow? It seems like it could get clunky to have the log lines.
- Would it allow you to commit changes to your own branch if it fails the check? I know the shellcheck can be strict sometimes and I usually only clean up the
verify
issues when I'm ready for review.
06a119a
to
b7119c2
Compare
Good questions! TL;DR, yes it does slow down the workflow bit.
Umm, it is a little subjective. How "slow" would be acceptable?
However, when any of the files is wrong(w.r.t linters) or is being run for the first time,
|
That's understandable :) |
/unhold |
It takes a little while to finish, even with small diffs. It does make me change my usual work pattern to be more deliberate about what I commit, but overall I like the tradeoff because I'll forget to run some of these verify targets otherwise. But it is a change: people should really try it out and see what they think. |
I like these checks overall, and I've gotten used to using |
I personally would prefer to work without it -- I typically prefer to save the checks until the end as a lot of my commits early on are usually very rough drafts. Is there a way to add an env config flag or file? |
+1 to what @Jont828 says. |
Maybe a compromise would be to move this to a |
Happy to hear your thoughts! :) This is an opt-in change rather than an enforcing one. Contributors should be running If someone wants to skip checks on individual commits after installing the pre-commit framework, then one can run |
Another PR sounds good to me. Also, I don't seem to see any Makefile changes in this PR, just the |
- verify-boilerplate - verify-modules - verify-shellcheck - verify-tiltfile - verify-codespell - add a note to skip pre-commit config
b7119c2
to
e54d5f4
Compare
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
I've been using the pre-commit hook since it merged, and I've tried this expanded version out. It fits my workflow and doesn't add too much time to git commit
IMHO. I use --no-verify
whenever I need to commit work in progress that I know won't pass these checks.
LGTM label has been added. Git tree hash: bef1cfcb82b48a89626a0ed5cf119727ca1f2fad
|
/lgtm @nawazkh Just to double check, if you don't run |
@Jont828 correct, see #3724 (comment) /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
pre-commit-config.yaml
to run local Makefile targets as part of pre-commit workflow.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Special notes for your reviewer:
Merge above PR before merging current PRs #3706 and #3630 before merging this PR.
TODOs:
Release note: