Add support for user git ignore configuration file. #2929
Labels
C: configuration
CLI and configuration
C: file collection
Related to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.
T: enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Include all sources of gitignore patterns.
I have user and host specific ignore rules in
~/$USER/.gitignore
that Black is unaware of.And just started adding black into my workflow at a project root level instead of an individual call to a specific file.
So the file finding process included python files in the .ropeproject folder of this project. (I only occasionally setup rope when I need it.)
Describe the solution you'd like
I would like to have the user/host gitignore files respected when project root
.gitignore
is used.get_gitignore
could use similar logic tofind_user_pyproject_toml
to add the lines from the user ignore file.Unfortunately this file is specified as either a default location or with a git configuration.
From https://git-scm.com/docs/gitignore
Describe alternatives you've considered
Add user specific files to project's
.gitignore
It wouldn't hurt to add vim and other tools to the project specific ignore files, but feels like I would be adding many user settings to a project. Although arguments for
.DS_Store
being in the project's.gitignore
is applicable for a project that is typically developed on Mac OS, it is just on the threshold.Adding vim swap files seems more user vs. project specific.
A workaround that I see now from researching for this bug would be to use
$GIT_DIR/info/exclude
but would also need to then have that path added into black.Additional context
Honestly this may be a non-issue, as it only affects my worktrees and not other users.
It may break future use of --check as unintentional user folders were included...
The text was updated successfully, but these errors were encountered: