-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
C: file collectionRelated to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.Related to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.C: integrationsEditor plugins and other integrationsEditor plugins and other integrationsT: documentationImprovements to the docs (e.g. new topic, correction, etc)Improvements to the docs (e.g. new topic, correction, etc)good first issueGood for newcomersGood for newcomers
Description
Perhaps we should document this issue in the FAQ? Using pre-commit with Black is pretty common (and it's not always instantly clear it passes all of the files to the hook directly bypassing any file discovery the hook may implement). I'd suggest pre-commit's exclude configurations first, and then black's force-exclude.
Originally posted by @ichard26 in #3013 (comment)
For context, we added the --force-exclude
option as pre-commit always passes all filepaths to the hook directly via the command line. It doesn't care whether the filepath came from the CLI or was recursively discovered, unlike --exclude
or --include
We could also document it here: https://black.readthedocs.io/en/stable/integrations/source_version_control.html
JelleZijlstra, wjh18 and pxc
Metadata
Metadata
Assignees
Labels
C: file collectionRelated to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.Related to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.C: integrationsEditor plugins and other integrationsEditor plugins and other integrationsT: documentationImprovements to the docs (e.g. new topic, correction, etc)Improvements to the docs (e.g. new topic, correction, etc)good first issueGood for newcomersGood for newcomers