Skip to content

Commit 99ecff2

Browse files
authored
Set tool.black.exclude so that stdlib/venv is not excluded when "manually" invoking Black (#15909)
1 parent 95aa599 commit 99ecff2

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,28 @@ target-version = ["py310"]
1111
skip-magic-trailing-comma = true
1212
preview = true
1313

14+
# Override `exclude` so that the `stdlib/venv` directory is not excluded
15+
# if you invoke Black "manually" (not using pre-commit). `venv` is one of
16+
# the directories that Black excludes by default if `tool.black.exclude`
17+
# is not set. See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#exclude
18+
exclude = '''
19+
/(
20+
\.env|
21+
\.venv|
22+
env|
23+
\.git|
24+
\.mypy_cache
25+
)/
26+
'''
27+
1428
[tool.ruff]
1529
line-length = 130
1630
fix = true
31+
32+
# Override `exclude` so that the `stdlib/venv` directory is not excluded
33+
# if you invoke Ruff "manually" (not using pre-commit). `venv` is one of
34+
# the directories that Ruff excludes by default if `tool.ruff.exclude`
35+
# is not set. See https://docs.astral.sh/ruff/configuration/
1736
exclude = [
1837
# virtual environment
1938
".env",

0 commit comments

Comments
 (0)