I'm trying to use pre-commit with autopep8 running the command pre-commit run --all-files
. My tree and files are as follows:
.
├── project
│ ├── ...
├── docs
│ ├── ...
│ └── conf.py
├── .flake8
├── .pre-commit-config.yaml
├── setup.cfg
├── setup.py
└── tox.ini
In .pre-commit-config.yaml
:
repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.4.4
hooks:
- id: autopep8
In .flake8
:
[flake8]
exclude=.git,__pycache__,docs/conf.py,build,dist
...
However when I run pre-commit run --all-files
, my .flake8 file wasn't getting picked up, so I tried adding --global-config to .flake8:
repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.4.4
hooks:
- id: autopep8
args: [--global-config, .flake8]
but that just results in an error:
autopep8: error: autopep8 only takes one filename as argument unless the "--in-place" or "--diff" args are used
What am I doing wrong?
My pre-commit version is 1.18.2.