From daaa07ae41e8e626dbc3aba39e929c7c2ebb9eaf Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 17 Jun 2025 19:49:54 -0400 Subject: [PATCH] Upgrade to ruff 0.12.0 --- .pre-commit-config.yaml | 2 +- cmd2/cmd2.py | 2 +- pyproject.toml | 45 +++++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5dd7c054..ceb73c42 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.10" + rev: "v0.12.0" hooks: - id: ruff-format args: [--config=pyproject.toml] diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index bc282e57..4ddda77a 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2610,7 +2610,7 @@ def _run_cmdfinalization_hooks(self, stop: bool, statement: Optional[Statement]) # caused by certain binary characters having been printed to it. import subprocess - proc = subprocess.Popen(['stty', 'sane']) # noqa: S603, S607 + proc = subprocess.Popen(['stty', 'sane']) # noqa: S607 proc.communicate() data = plugin.CommandFinalizationData(stop, statement) diff --git a/pyproject.toml b/pyproject.toml index 4590514f..abb3152a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -222,28 +222,29 @@ select = [ ] ignore = [ # `uv run ruff rule E501` for a description of that rule - "ANN401", # Dynamically typed expressions (typing.Any) are disallowed (would be good to enable this later) - "B905", # zip() without an explicit strict= parameter (strict added in Python 3.10+) - "COM812", # Conflicts with ruff format (see https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules) - "COM819", # Conflicts with ruff format - "D203", # 1 blank line required before class docstring (conflicts with D211) - "D206", # Conflicts with ruff format - "D213", # Multi-line docstring summary should start at 2nd line (conflicts with D212 which starts at 1st line) - "D300", # Conflicts with ruff format - "E111", # Conflicts with ruff format - "E114", # Conflicts with ruff format - "E117", # Conflicts with ruff format - "ISC002", # Conflicts with ruff format - "Q000", # Conflicts with ruff format - "Q001", # Conflicts with ruff format - "Q002", # Conflicts with ruff format - "Q003", # Conflicts with ruff format - "TC006", # Add quotes to type expression in typing.cast() (not needed except for forward references) - "TRY003", # Avoid specifying long messages outside the exception class (force custom exceptions for everything) - "UP007", # Use X | Y for type annotations (requires Python 3.10+) - "UP017", # Use datetime.UTC alias (requires Python 3.11+) - "UP038", # Use X | Y in {} call instead of (X, Y) - deprecated due to poor performance (requires Python 3.10+) - "W191", # Conflicts with ruff format + "ANN401", # Dynamically typed expressions (typing.Any) are disallowed (would be good to enable this later) + "B905", # zip() without an explicit strict= parameter (strict added in Python 3.10+) + "COM812", # Conflicts with ruff format (see https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules) + "COM819", # Conflicts with ruff format + "D203", # 1 blank line required before class docstring (conflicts with D211) + "D206", # Conflicts with ruff format + "D213", # Multi-line docstring summary should start at 2nd line (conflicts with D212 which starts at 1st line) + "D300", # Conflicts with ruff format + "E111", # Conflicts with ruff format + "E114", # Conflicts with ruff format + "E117", # Conflicts with ruff format + "ISC002", # Conflicts with ruff format + "PLC0415", # `import` should be at the top-level of a file" + "Q000", # Conflicts with ruff format + "Q001", # Conflicts with ruff format + "Q002", # Conflicts with ruff format + "Q003", # Conflicts with ruff format + "TC006", # Add quotes to type expression in typing.cast() (not needed except for forward references) + "TRY003", # Avoid specifying long messages outside the exception class (force custom exceptions for everything) + "UP007", # Use X | Y for type annotations (requires Python 3.10+) + "UP017", # Use datetime.UTC alias (requires Python 3.11+) + "UP038", # Use X | Y in {} call instead of (X, Y) - deprecated due to poor performance (requires Python 3.10+) + "W191", # Conflicts with ruff format ] # Allow fix for all enabled rules (when `--fix`) is provided.