Skip to content
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

Feature request: display diff of not-applied changes #65

Open
StanczakDominik opened this issue May 8, 2021 · 6 comments
Open

Feature request: display diff of not-applied changes #65

StanczakDominik opened this issue May 8, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@StanczakDominik
Copy link

The recently added autofix_prs flag is awesome, it allowed me to convince folks at PlasmaPy to switch to pre-commit.ci! However, one thing that's a bit annoying as a result is that, if a pre-commit hook fails, the actual applied changes are nowhere to be seen:

image

With autofix_prs disabled, this means one has to either run pre-commit autofix (which modifies the branch, and people can be sensitive about touching their branches) or install pre-commit locally.

But the pre-commit result would already be there, and showing the diff would probably be a simple matter of adding --show-diff-on-failure (possibly optionally, if not autofix_prs?) to pre-commit run, if I'm correct?

@asottile
Copy link
Member

asottile commented May 8, 2021

the diff in most cases is too large to store / show without drastically increasing the operating costs (as even with 2 files of diff it's going to be bigger than just the pre-commit output)

@asottile
Copy link
Member

asottile commented May 8, 2021

(I could show it, but 99% of the time it's going to get cut off by the output limiter)

@asottile
Copy link
Member

asottile commented May 8, 2021

hmmm one idea would be to push anyway, but to an orphaned commit (which github keeps around forever) and provide a link -- let me see how difficult that would be

@asottile asottile added enhancement New feature or request and removed question labels May 9, 2021
@asottile asottile changed the title Feature request: display diff of applied changes Feature request: display diff of not-applied changes May 9, 2021
@StanczakDominik
Copy link
Author

the diff in most cases is too large to store / show without drastically increasing the operating costs (as even with 2 files of diff it's going to be bigger than just the pre-commit output)

Oh crap, I didn't think of that. In that case, if the push-to-orphan commit idea doesn't end up feasible, feel free to close this one!

@StanczakDominik
Copy link
Author

Hey, out of curiosity, did you ever try out the push-to-orphan idea?

@asottile
Copy link
Member

asottile commented Aug 12, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants