Closed marfox closed 3 years ago
I tried to reproduce the same invocation of isort, autoflake, black as in .travis.yml
in the terminal, but the output is different.
/app/soweego# pre-commit run -a
Here's the .pre-commit-config.yaml
I used:
repos:
- repo: https://github.com/pycqa/isort
rev: 4.3.21
hooks:
- id: isort
args: [-y, -rc, -s soweego/cli.py]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: [-i, -r, --remove-all-unused-imports, --remove-unused-variables]
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
args: [-S, -l 80]
Let'see what happens with the CI service
It looks like the isort
hook doesn't work as expected: for instance, it ignores the -s soweego/cli.py
option, and actually runs on that file, too.
Very interesting suggestion! We currently have a similar mechanism in place on Travis CI, see this dotfile. However, it's a bit hacky and doesn't run mypy type hints check. From a first glimpse, it looks like pre-commit is a much better solution:
Originally posted by @marfox in https://github.com/Wikidata/soweego/issues/428#issuecomment-911864333