-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
build(ci): Provide diff for pre-commit failures #25638
Conversation
Signed-off-by: Josh Soref <[email protected]>
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! Let's try this out
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.
Thanks! Pinging @craig-rueda to see if he has any objections since he knows more about the helm risks than I do.
@@ -86,7 +86,12 @@ jobs: | |||
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}" | |||
brew install norwoodj/tap/helm-docs | |||
- name: pre-commit | |||
run: pre-commit run --all-files |
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.
@jsoref and @craig-rueda would the pre-commit run
--show-diff-on-failure
flag be suffice?
--show-diff-on-failure When hooks fail, run `git diff` directly afterward.
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.
Maybe. I don't use this tool. As long as I can apply the diff and get it not to fail going forward.
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.
Seems like a good idea. I don't know much about pre commit tbh
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
SUMMARY
when pre-commit fails, it's typically because of changes made by one of the tools. As it knows what the changes are, this change provides access to people so that they can use
patch -p1
to apply the changes instead of just being frustrated by an unhelpful CI.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
https://github.com/apache/superset/actions/runs/6507284267/job/17674397883
After:
https://github.com/check-spelling-sandbox/superset/actions/runs/6509697746/job/17681762469
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION