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

--show-diff-on-failure does not respect --color #1007

Closed
chadrik opened this issue Apr 24, 2019 · 8 comments

Comments

Projects
None yet
3 participants
@chadrik
Copy link

commented Apr 24, 2019

I'm running pre-commit on gitlab, and I noticed that the diffs produced when --show-diff-on-failure is enabled do not respect --color=always.

It looks like a pretty easy fix: we just need to pass the --color setting to git diff. It supports the same "auto", "always", "never" settings as pre-commit.

git diff --color documentation.

code in question: https://github.com/pre-commit/pre-commit/blob/master/pre_commit/commands/run.py#L227

@asottile

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

want to submit a PR?

@chadrik

This comment has been minimized.

Copy link
Author

commented Apr 24, 2019

Sure!

@asottile

This comment has been minimized.

Copy link
Member

commented May 15, 2019

@chadrik ping!

@mandarvaze

This comment has been minimized.

Copy link
Contributor

commented May 30, 2019

@chadrik If you are busy/not working on this, can I give it a try ?
I came here looking for "good-first-issue"

@asottile

This comment has been minimized.

Copy link
Member

commented May 30, 2019

@mandarvaze I say go for it 👍 -- let me know if you want some more directed pointers about where this code is and what to pass through :)

@chadrik

This comment has been minimized.

Copy link
Author

commented May 31, 2019

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

this has been released as part of v1.17.0 -- thanks again for the issue!

@chadrik

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.