Skip to content

Commit 744bc88

Browse files
dependabot[bot]sfc-gh-bniscoclaude
authored
Bump ruff from 0.15.21 to 0.15.22 (#73)
* Bump ruff from 0.15.21 to 0.15.22 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.21 to 0.15.22. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/0.15.22/CHANGELOG.md) - [Commits](astral-sh/ruff@0.15.21...0.15.22) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.15.22 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * chore: apply ruff 0.15.22 preview autofixes Ruff 0.15.22 enables two new preview rules under select=ALL: RUF201 (rule-codes-in-selectors) and RUF105 (noqa-comments). Applied `ruff check --fix` + `ruff format` to migrate rule codes to names in the config and `# noqa:` comments to `# ruff:ignore[...]`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bob Nisco <bob.nisco@snowflake.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5e0122a commit 744bc88

10 files changed

Lines changed: 72 additions & 72 deletions

app/frontend_bundle_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def render_bundle_treemap(title: str, bundle_data: list | None) -> None:
264264
color_continuous_scale="Blues",
265265
hover_data={"Size (Human)": True},
266266
)
267-
fig.update_traces(hovertemplate="<b>%{label}</b><br>Size: %{customdata[0]}<extra></extra>") # noqa: RUF027
267+
fig.update_traces(hovertemplate="<b>%{label}</b><br>Size: %{customdata[0]}<extra></extra>") # ruff:ignore[missing-f-string-syntax]
268268

269269
st.markdown(f"**{title}**")
270270
st.plotly_chart(fig, width="stretch")

app/github_stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import operator
22
import re
3-
import subprocess # noqa: S404
3+
import subprocess # ruff:ignore[suspicious-subprocess-import]
44
import tempfile
55
from datetime import date
66

@@ -32,8 +32,8 @@ def get_git_fame_stats() -> dict:
3232
# Use a temporary directory
3333
with tempfile.TemporaryDirectory() as temp_dir:
3434
# Clone the repository
35-
subprocess.run( # noqa: S603
36-
["git", "clone", "https://github.com/" + GITHUB_REPO, temp_dir], # noqa: S607
35+
subprocess.run( # ruff:ignore[subprocess-without-shell-equals-true]
36+
["git", "clone", "https://github.com/" + GITHUB_REPO, temp_dir], # ruff:ignore[start-process-with-partial-path]
3737
check=True,
3838
capture_output=True,
3939
)

app/issue_explorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ def issue_sort_key(issue_name: str) -> tuple[int, int, str]:
184184
script_content = pathlib.Path(selected_issue_folder_path.joinpath(DEFAULT_SCRIPT_NAME)).read_text(
185185
encoding="utf-8"
186186
)
187-
exec(script_content) # noqa: S102
187+
exec(script_content) # ruff:ignore[exec-builtin]

app/load_testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _parse_load_test_payload(content: bytes) -> dict[str, Any] | None:
9292
if name.endswith(".json"):
9393
with zip_file.open(name) as f:
9494
return json.load(f)
95-
except Exception: # noqa: S110
95+
except Exception: # ruff:ignore[try-except-pass]
9696
pass
9797

9898
return None

app/perf/utils/artifacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _extract_lighthouse_scores(zip_bytes: bytes) -> dict[str, float]:
6969
continue
7070
try:
7171
score = payload["categories"]["performance"]["score"]
72-
except Exception: # noqa: S112
72+
except Exception: # ruff:ignore[try-except-continue]
7373
continue
7474

7575
# Keep the same (slightly odd) key derivation behavior as the prior disk-based parser.

app/perf/utils/perf_github_artifacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def process_artifact(
3838
continue
3939
try:
4040
score = payload["categories"]["performance"]["score"]
41-
except Exception: # noqa: S112
41+
except Exception: # ruff:ignore[try-except-continue]
4242
continue
4343

4444
parts = member_name.split("_-_")

app/utils/agent_wiki.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import posixpath
55
import re
66
import shutil
7-
import subprocess # noqa: S404
7+
import subprocess # ruff:ignore[suspicious-subprocess-import]
88
import tempfile
99
from pathlib import Path
1010
from typing import TypedDict
@@ -56,8 +56,8 @@ def _run_git_command(
5656
cwd: Path | None = None,
5757
) -> tuple[str | None, str | None]:
5858
try:
59-
completed_process = subprocess.run( # noqa: S603
60-
["git", *args], # noqa: S607
59+
completed_process = subprocess.run( # ruff:ignore[subprocess-without-shell-equals-true]
60+
["git", *args], # ruff:ignore[start-process-with-partial-path]
6161
cwd=cwd,
6262
check=False,
6363
capture_output=True,

app/utils/smokeshow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def upload_to_smokeshow(directory_path: Path) -> str:
6868
upload_root: str = obj["url"]
6969

7070
# Create a list of files to upload
71-
files_to_upload = [(p, p.relative_to(directory_path)) for p in directory_path.glob("**/*") if p.is_file()] # noqa: ASYNC240
71+
files_to_upload = [(p, p.relative_to(directory_path)) for p in directory_path.glob("**/*") if p.is_file()] # ruff:ignore[blocking-path-method-in-async-function]
7272

7373
# Create a semaphore to limit concurrent uploads to 60
7474
semaphore = asyncio.Semaphore(SMOKESHOW_MAX_CONCURRENT_UPLOADS)
@@ -105,7 +105,7 @@ async def _upload_file(
105105
upload_root: str,
106106
file_path: Path,
107107
rel_path: Path,
108-
timeout: int, # noqa: ASYNC109
108+
timeout: int, # ruff:ignore[async-function-with-timeout]
109109
) -> None:
110110
"""Upload a single file to smokeshow."""
111111
url_path = str(rel_path)
@@ -119,7 +119,7 @@ async def _upload_file(
119119
try:
120120
response = await client.post(
121121
upload_root + url_path,
122-
content=file_path.read_bytes(), # noqa: ASYNC240
122+
content=file_path.read_bytes(), # ruff:ignore[blocking-path-method-in-async-function]
123123
headers=headers,
124124
timeout=timeout,
125125
)

pyproject.toml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ default-groups = ["dev"]
4747
[dependency-groups]
4848
dev = [
4949
"pytest>=9.0.2",
50-
"ruff==0.15.21",
50+
"ruff==0.15.22",
5151
"ty==0.0.62",
5252
"mypy==2.3.0",
5353
"watchdog",
@@ -81,40 +81,40 @@ ignore = [
8181
"DOC", # Checks for correct docstring format.
8282
"FBT", # Checks for Boolean-typed positional argument in function definition.
8383
# Ignored rules (sorted alphabetically):
84-
"ANN401", # Allow Any type in annotations.
85-
"COM812", # Trailing comma missing. Not recommended with formatter.
86-
"COM819", # Trailing comma prohibited. Not recommended with formatter.
87-
"D100", # Missing docstring in public module.
88-
"D101", # Missing docstring in public class.
89-
"D103", # Missing docstring in public function.
90-
"D104", # Missing docstring in public package.
91-
"D107", # Missing docstring in __init__.
92-
"E501", # Line too long. Ignored for user-facing strings and help text.
93-
"ERA001", # Commented out code.
94-
"FIX002", # Disallow TODO comments.
95-
"FURB152", # Math constants should use math module.
96-
"PLC0415", # Imports not at top-level.
97-
"PLC2701", # Import of private name.
98-
"PLR0904", # Too many public methods.
99-
"PLR0911", # Too many return statements.
100-
"PLR0912", # Too many branches.
101-
"PLR0913", # Too many arguments.
102-
"PLR0914", # Too many local variables.
103-
"PLR0915", # Too many statements.
104-
"PLR0916", # Too many boolean expressions.
105-
"PLR0917", # Too many positional arguments.
106-
"PLR1702", # Too many nested blocks.
107-
"PLR2004", # Magic value used in comparison.
108-
"PLR6301", # Method could be function (no self usage).
109-
"PLW0717", # Too many statements in try clause.
110-
"RET504", # Unnecessary assignment before return.
111-
"RUF052", # Dummy variable accessed.
112-
"RUF067", # Non-empty __init__ module.
113-
"SIM117", # Multiple with statements should be combined.
114-
"T201", # Print statement found.
115-
"TD002", # Missing author in TODO.
116-
"TD003", # Missing issue link in TODO.
117-
"TRY300", # Consider else block instead of return in try.
84+
"any-type", # Allow Any type in annotations.
85+
"missing-trailing-comma", # Trailing comma missing. Not recommended with formatter.
86+
"prohibited-trailing-comma", # Trailing comma prohibited. Not recommended with formatter.
87+
"undocumented-public-module", # Missing docstring in public module.
88+
"undocumented-public-class", # Missing docstring in public class.
89+
"undocumented-public-function", # Missing docstring in public function.
90+
"undocumented-public-package", # Missing docstring in public package.
91+
"undocumented-public-init", # Missing docstring in __init__.
92+
"line-too-long", # Line too long. Ignored for user-facing strings and help text.
93+
"commented-out-code", # Commented out code.
94+
"line-contains-todo", # Disallow TODO comments.
95+
"math-constant", # Math constants should use math module.
96+
"import-outside-top-level", # Imports not at top-level.
97+
"import-private-name", # Import of private name.
98+
"too-many-public-methods", # Too many public methods.
99+
"too-many-return-statements", # Too many return statements.
100+
"too-many-branches", # Too many branches.
101+
"too-many-arguments", # Too many arguments.
102+
"too-many-locals", # Too many local variables.
103+
"too-many-statements", # Too many statements.
104+
"too-many-boolean-expressions", # Too many boolean expressions.
105+
"too-many-positional-arguments", # Too many positional arguments.
106+
"too-many-nested-blocks", # Too many nested blocks.
107+
"magic-value-comparison", # Magic value used in comparison.
108+
"no-self-use", # Method could be function (no self usage).
109+
"too-many-statements-in-try-clause", # Too many statements in try clause.
110+
"unnecessary-assign", # Unnecessary assignment before return.
111+
"used-dummy-variable", # Dummy variable accessed.
112+
"non-empty-init-module", # Non-empty __init__ module.
113+
"multiple-with-statements", # Multiple with statements should be combined.
114+
"print", # Print statement found.
115+
"missing-todo-author", # Missing author in TODO.
116+
"missing-todo-link", # Missing issue link in TODO.
117+
"try-consider-else", # Consider else block instead of return in try.
118118
]
119119

120120
[tool.ruff.lint.per-file-ignores]
@@ -128,7 +128,7 @@ ignore = [
128128
"S", # Ignore bandit security rules (test code doesn't need security hardening).
129129
"TRY", # Ignore tryceratops rules (simpler exception handling in tests).
130130
]
131-
extend-safe-fixes = ["TC002", "TC003"]
131+
extend-safe-fixes = ["typing-only-third-party-import", "typing-only-standard-library-import"]
132132

133133
[tool.ruff.lint.isort]
134134
known-first-party = ["app"]

0 commit comments

Comments
 (0)