Skip to content

Commit

Permalink
Fix black exclusions to omit .gitignore dirs
Browse files Browse the repository at this point in the history
This replaces "exclude" with "extend-exclude" in the black
configuration, so that it keeps its default exclusions, of which
all directories listed in .gitignore are automatically a part.
That makes it possible to run "black ." to format just the files
that should be formatted (git/ files, test/ files, and setup.py),
while automatically omitting .venv/, .tox/, build/, and so on.

This commit does not change how black is run yet, it just fixes
the way its exclusions are configured.
  • Loading branch information
EliahKagan committed Sep 19, 2023
1 parent 1256b16 commit a774182
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ omit = ["*/git/ext/*"]
[tool.black]
line-length = 120
target-version = ['py37']
exclude = "git/ext/gitdb"
extend-exclude = "git/ext/gitdb"

0 comments on commit a774182

Please sign in to comment.