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
Closed

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

chadrik opened this issue Apr 24, 2019 · 8 comments

Comments

@chadrik
Copy link

@chadrik 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

@asottile asottile commented Apr 24, 2019

want to submit a PR?

@chadrik
Copy link
Author

@chadrik chadrik commented Apr 24, 2019

Sure!

@asottile
Copy link
Member

@asottile asottile commented May 15, 2019

@chadrik ping!

@mandarvaze
Copy link
Contributor

@mandarvaze mandarvaze 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
Copy link
Member

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

@chadrik chadrik commented May 31, 2019

@asottile
Copy link
Member

@asottile 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 chadrik commented Jun 6, 2019

kvalkhof75 pushed a commit to kvalkhof75/pre-commit that referenced this issue Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants