diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed8a6403..6922db3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,8 +14,8 @@ repos: - id: check-merge-conflict - id: mixed-line-ending - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.264" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.2.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index c6a1005d..43360176 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,19 @@ [tool.ruff] -# https://beta.ruff.rs/docs/configuration/ +exclude = [ + ".eggs", + ".git", + ".mypy_cache", + ".ruff_cache", + ".env", + ".venv", + "**migrations/**", + "node_modules", + "venv", +] line-length = 120 + +[tool.ruff.lint] +# https://beta.ruff.rs/docs/configuration/ select = [ "E", # pycodestyle errors "W", # pycodestyle warnings @@ -15,18 +28,6 @@ select = [ "UP", # pyupgrade ] -exclude = [ - ".eggs", - ".git", - ".mypy_cache", - ".ruff_cache", - ".env", - ".venv", - "**migrations/**", - "node_modules", - "venv", -] - ignore = [ "B006", # Do not use mutable data structures for argument defaults "B011", # tests use assert False @@ -43,12 +44,12 @@ ignore = [ "UP007", # Use `X | Y` for type annotations ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "__init__.py" = [ "F401" # unused-import ] -[tool.ruff.isort] +[tool.ruff.lint.isort] combine-as-imports = true known-first-party = [ "djangocms_versioning",