Skip to content

Commit

Permalink
Have black and isort respect .gitignore
Browse files Browse the repository at this point in the history
For black, setting `exclude` unintentionally overrode black's default of
ignoring files listed in .gitignore. isort requires setting an explicit
`skip_gitignore` option.

Notably this will automatically have both tools ignore target/, which in
some cases does contain Python code.

Fixes #6852.
  • Loading branch information
legoktm committed Jun 23, 2023
1 parent 264b62c commit 25c0db0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.black]
line-length = 100
target-version = ["py38"]
exclude = "securedrop/config.py"
extend-exclude = ".venv"
# Don't use `extend`, we want the default behavior that honors .gitignore rules

[tool.isort]
line_length = 100
profile = "black"
skip_gitignore = true

[tool.mypy]
ignore_missing_imports = true
Expand Down

0 comments on commit 25c0db0

Please sign in to comment.