Skip to content

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

Closed

Description

@chadrik

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

Activity

  1. asottile commented on Apr 24, 2019

    @asottile
    Member

    want to submit a PR?

  2. chadrik commented on Apr 24, 2019

    @chadrik
    Author

    Sure!

  3. asottile commented on May 15, 2019

    @asottile
    Member

    @chadrik ping!

  4. mandarvaze commented on May 30, 2019

    @mandarvaze
    Contributor

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

  5. asottile commented on May 30, 2019

    @asottile
    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 :)

  6. chadrik commented on May 31, 2019

    @chadrik
    Author
  7. added a commit that references this issue on May 31, 2019
    4f4767c
  8. asottile commented on Jun 6, 2019

    @asottile
    Member

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

  9. chadrik commented on Jun 6, 2019

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions