yapf -i and pass pre-commit check · Issue #747 · pre-commit/pre-commit · GitHub
Skip to content

yapf -i and pass pre-commit check #747

Description

@jasonkuhrt

It seems that in #285 you made it so that when a tool like yapf formats code inline pre-commit will always mark the check as failed, because files were changed. Is this correct?

If so, funnily enough the behaviour I'm looking for is the exact thing you felt was a "fix". I'd like this to be able to pass:

[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/jasonkuhrt/.cache/pre-commit/patch1525490932.
yapf.....................................................................Failed
hookid: yapf

Files were modified by this hook.

[INFO] Restored changes from /Users/jasonkuhrt/.cache/pre-commit/patch1525490932.

I suppose that would require pre-commit to stage the auto formatted changes automatically too.

Any chance of supporting this? Its how pretty-quick works for example.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions