Skip to content

Upgrade to ruff 0.12.0 #1449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
45 changes: 23 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading