diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 580464f910..1825d34f6f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: stages: [manual] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.0 + rev: v0.15.8 hooks: - id: ruff-check args: [--color=always] diff --git a/pyproject.toml b/pyproject.toml index b68613d9cb..f00b29327a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,20 +21,25 @@ preview = true fix = true [tool.ruff.lint] +# NOTE: Starting with `0.15.2`, ruff uses a SIGNIFICANTLY expanded set of default rules for +# preview builds. While expanding into these new rulesets is something we're interested in, +# we'll adopt them gradually, depending on our needs. As such, our base `select` utilizes the +# legacy defaults. +select = ["E4", "E7", "E9", "F"] extend-select = [ - "I", # isort - "UP006", # Use {to} instead of {from} for type annotation - "UP007", # Use `X | Y` for type annotations - "UP037", # Remove quotes from type annotation - "FA", # Future annotations + "FA", # flake8-future-annotations. + "I", # isort. + "UP006", # Use {to} instead of {from} for type annotation. + "UP007", # Use `X | Y` for type annotations. + "UP037", # Remove quotes from type annotation. ] -extend-safe-fixes = ["UP006", "UP007", "FA"] +extend-safe-fixes = ["FA", "UP006", "UP007"] [tool.ruff.lint.per-file-ignores] "{SConstruct,SCsub}" = [ - "E402", # Module level import not at top of file - "F403", # Undefined local with import star - "F405", # Undefined local with import star usage + "E402", # Module level import not at top of file. + "F403", # Undefined local with import star. + "F405", # Undefined local with import star usage. ] [tool.ruff.lint.isort]