Skip to content

Commit eb5eb6c

Browse files
authored
Upgrade to ruff 0.12.0 (#1449)
1 parent 8de6227 commit eb5eb6c

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: trailing-whitespace
1010

1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: "v0.11.10"
12+
rev: "v0.12.0"
1313
hooks:
1414
- id: ruff-format
1515
args: [--config=pyproject.toml]

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ def _run_cmdfinalization_hooks(self, stop: bool, statement: Optional[Statement])
26102610
# caused by certain binary characters having been printed to it.
26112611
import subprocess
26122612

2613-
proc = subprocess.Popen(['stty', 'sane']) # noqa: S603, S607
2613+
proc = subprocess.Popen(['stty', 'sane']) # noqa: S607
26142614
proc.communicate()
26152615

26162616
data = plugin.CommandFinalizationData(stop, statement)

pyproject.toml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -222,28 +222,29 @@ select = [
222222
]
223223
ignore = [
224224
# `uv run ruff rule E501` for a description of that rule
225-
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed (would be good to enable this later)
226-
"B905", # zip() without an explicit strict= parameter (strict added in Python 3.10+)
227-
"COM812", # Conflicts with ruff format (see https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules)
228-
"COM819", # Conflicts with ruff format
229-
"D203", # 1 blank line required before class docstring (conflicts with D211)
230-
"D206", # Conflicts with ruff format
231-
"D213", # Multi-line docstring summary should start at 2nd line (conflicts with D212 which starts at 1st line)
232-
"D300", # Conflicts with ruff format
233-
"E111", # Conflicts with ruff format
234-
"E114", # Conflicts with ruff format
235-
"E117", # Conflicts with ruff format
236-
"ISC002", # Conflicts with ruff format
237-
"Q000", # Conflicts with ruff format
238-
"Q001", # Conflicts with ruff format
239-
"Q002", # Conflicts with ruff format
240-
"Q003", # Conflicts with ruff format
241-
"TC006", # Add quotes to type expression in typing.cast() (not needed except for forward references)
242-
"TRY003", # Avoid specifying long messages outside the exception class (force custom exceptions for everything)
243-
"UP007", # Use X | Y for type annotations (requires Python 3.10+)
244-
"UP017", # Use datetime.UTC alias (requires Python 3.11+)
245-
"UP038", # Use X | Y in {} call instead of (X, Y) - deprecated due to poor performance (requires Python 3.10+)
246-
"W191", # Conflicts with ruff format
225+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed (would be good to enable this later)
226+
"B905", # zip() without an explicit strict= parameter (strict added in Python 3.10+)
227+
"COM812", # Conflicts with ruff format (see https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules)
228+
"COM819", # Conflicts with ruff format
229+
"D203", # 1 blank line required before class docstring (conflicts with D211)
230+
"D206", # Conflicts with ruff format
231+
"D213", # Multi-line docstring summary should start at 2nd line (conflicts with D212 which starts at 1st line)
232+
"D300", # Conflicts with ruff format
233+
"E111", # Conflicts with ruff format
234+
"E114", # Conflicts with ruff format
235+
"E117", # Conflicts with ruff format
236+
"ISC002", # Conflicts with ruff format
237+
"PLC0415", # `import` should be at the top-level of a file"
238+
"Q000", # Conflicts with ruff format
239+
"Q001", # Conflicts with ruff format
240+
"Q002", # Conflicts with ruff format
241+
"Q003", # Conflicts with ruff format
242+
"TC006", # Add quotes to type expression in typing.cast() (not needed except for forward references)
243+
"TRY003", # Avoid specifying long messages outside the exception class (force custom exceptions for everything)
244+
"UP007", # Use X | Y for type annotations (requires Python 3.10+)
245+
"UP017", # Use datetime.UTC alias (requires Python 3.11+)
246+
"UP038", # Use X | Y in {} call instead of (X, Y) - deprecated due to poor performance (requires Python 3.10+)
247+
"W191", # Conflicts with ruff format
247248
]
248249

249250
# Allow fix for all enabled rules (when `--fix`) is provided.

0 commit comments

Comments
 (0)