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 · Fixed by #1051
Closed

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

chadrik opened this issue Apr 24, 2019 · 8 comments · Fixed by #1051

Comments

@chadrik
Copy link

chadrik 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
Copy link
Member

want to submit a PR?

@chadrik
Copy link
Author

chadrik commented Apr 24, 2019

Sure!

@asottile
Copy link
Member

@chadrik ping!

@mandarvaze
Copy link
Contributor

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

@asottile
Copy link
Member

@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
Copy link
Author

chadrik commented May 31, 2019 via email

@asottile
Copy link
Member

asottile commented Jun 6, 2019

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

@chadrik
Copy link
Author

chadrik commented Jun 6, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants