autoflake icon indicating copy to clipboard operation
autoflake copied to clipboard

Option to also print diffs when using `--in-place`

Open verhovsky opened this issue 5 years ago • 1 comments

I'm running autoflake as a hook with pre-commit:

- repo: https://github.com/myint/autoflake
  rev: v1.4
  hooks:
    - id: autoflake
      args: ['--in-place', '--remove-all-unused-imports', '--ignore-init-module-imports']

When autoflake makes some changes, all it says is that it made some changes:

autoflake................................................................Failed
- hook id: autoflake
- files were modified by this hook

but doesn't say what or where, I have to look at my unstaged files to see what happened. Since it usually doesn't make too many changes, it would be helpful if there was a flag that would print the diff and make the changes.

verhovsky avatar Aug 30 '20 07:08 verhovsky

@verhovsky pre-commit run --show-diff-on-failure

graingert avatar Sep 20 '20 09:09 graingert