Closed neutrinoceros closed 3 years ago
exclude
from pyproject.toml
only works when running black
on a directory, I think you want force-exclude, check the black
docs
pre-commit run locally doesn't reproduce this behaviour,
are you sure? did you run pre-commit run --all-files
?
are you sure? did you run pre-commit run --all-files?
Indeed adding the --all-files
flag produces consistent changes with what happens on my pr.
exclude from pyproject.toml only works when running black on a directory, I think you want force-exclude, check the black docs
I wasn't aware of force-exclude
, though it ought to be noted that changing exclude
to force-exclude
in my configuration doesn't affect pre-commit's behaviour (but then it's not a problem in pre-commit.ci). Thanks for your answer, I think this can be closed.
Hi ! I just tried to setup pre-commit-ci on a project where I use the code formatter
black
. I report that pre-commit-ci seems run the corresponding hook in a way that ignores the associated configuration frompyproject.toml
. Specifically, my config excludeswhych/externs
from black's scope, but as can be seen on this PR, it is applied there anyway: https://github.com/neutrinoceros/whych/pull/2As running either
black .
orpre-commit run
locally doesn't reproduce this behaviour, I assume this is a bug in pre-commit-ci