Skip to content

Commit

Permalink
ENH: remove target-version from ruff configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Sep 2, 2024
1 parent eb20377 commit 01abcec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ src = [
"src",
"tests",
]
target-version = "py37"

[tool.ruff.format]
docstring-code-format = true
Expand Down
11 changes: 9 additions & 2 deletions src/compwa_policy/check_dev_files/ruff.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,18 @@ def __update_global_settings(
pyproject: ModifiablePyproject, has_notebooks: bool
) -> None:
settings = pyproject.get_table("tool.ruff", create=True)
minimal_settings = {
minimal_settings: dict[str, Any] = {
"preview": True,
"show-fixes": True,
"target-version": ___get_target_version(pyproject),
}
project = pyproject.get_table("project", create=True)
if "requires-python" in project:
if settings.get("target-version") is not None:
settings.pop("target-version")
msg = "Removed target-version from Ruff configuration"
pyproject.append_to_changelog(msg)
else:
minimal_settings["target-version"] = ___get_target_version(pyproject)
if has_notebooks:
key = "extend-include"
default_includes = sorted({
Expand Down

0 comments on commit 01abcec

Please sign in to comment.