Skip to content
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 app/frontend_bundle_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def render_bundle_treemap(title: str, bundle_data: list | None) -> None:
color_continuous_scale="Blues",
hover_data={"Size (Human)": True},
)
fig.update_traces(hovertemplate="<b>%{label}</b><br>Size: %{customdata[0]}<extra></extra>") # noqa: RUF027
fig.update_traces(hovertemplate="<b>%{label}</b><br>Size: %{customdata[0]}<extra></extra>") # ruff:ignore[missing-f-string-syntax]

st.markdown(f"**{title}**")
st.plotly_chart(fig, width="stretch")
Expand Down
6 changes: 3 additions & 3 deletions app/github_stats.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import operator
import re
import subprocess # noqa: S404
import subprocess # ruff:ignore[suspicious-subprocess-import]
import tempfile
from datetime import date

Expand Down Expand Up @@ -32,8 +32,8 @@ def get_git_fame_stats() -> dict:
# Use a temporary directory
with tempfile.TemporaryDirectory() as temp_dir:
# Clone the repository
subprocess.run( # noqa: S603
["git", "clone", "https://github.com/" + GITHUB_REPO, temp_dir], # noqa: S607
subprocess.run( # ruff:ignore[subprocess-without-shell-equals-true]
["git", "clone", "https://github.com/" + GITHUB_REPO, temp_dir], # ruff:ignore[start-process-with-partial-path]
check=True,
capture_output=True,
)
Expand Down
2 changes: 1 addition & 1 deletion app/issue_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ def issue_sort_key(issue_name: str) -> tuple[int, int, str]:
script_content = pathlib.Path(selected_issue_folder_path.joinpath(DEFAULT_SCRIPT_NAME)).read_text(
encoding="utf-8"
)
exec(script_content) # noqa: S102
exec(script_content) # ruff:ignore[exec-builtin]
2 changes: 1 addition & 1 deletion app/load_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _parse_load_test_payload(content: bytes) -> dict[str, Any] | None:
if name.endswith(".json"):
with zip_file.open(name) as f:
return json.load(f)
except Exception: # noqa: S110
except Exception: # ruff:ignore[try-except-pass]
pass

return None
Expand Down
2 changes: 1 addition & 1 deletion app/perf/utils/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _extract_lighthouse_scores(zip_bytes: bytes) -> dict[str, float]:
continue
try:
score = payload["categories"]["performance"]["score"]
except Exception: # noqa: S112
except Exception: # ruff:ignore[try-except-continue]
continue

# Keep the same (slightly odd) key derivation behavior as the prior disk-based parser.
Expand Down
2 changes: 1 addition & 1 deletion app/perf/utils/perf_github_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def process_artifact(
continue
try:
score = payload["categories"]["performance"]["score"]
except Exception: # noqa: S112
except Exception: # ruff:ignore[try-except-continue]
continue

parts = member_name.split("_-_")
Expand Down
6 changes: 3 additions & 3 deletions app/utils/agent_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import posixpath
import re
import shutil
import subprocess # noqa: S404
import subprocess # ruff:ignore[suspicious-subprocess-import]
import tempfile
from pathlib import Path
from typing import TypedDict
Expand Down Expand Up @@ -56,8 +56,8 @@ def _run_git_command(
cwd: Path | None = None,
) -> tuple[str | None, str | None]:
try:
completed_process = subprocess.run( # noqa: S603
["git", *args], # noqa: S607
completed_process = subprocess.run( # ruff:ignore[subprocess-without-shell-equals-true]
["git", *args], # ruff:ignore[start-process-with-partial-path]
cwd=cwd,
check=False,
capture_output=True,
Expand Down
6 changes: 3 additions & 3 deletions app/utils/smokeshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def upload_to_smokeshow(directory_path: Path) -> str:
upload_root: str = obj["url"]

# Create a list of files to upload
files_to_upload = [(p, p.relative_to(directory_path)) for p in directory_path.glob("**/*") if p.is_file()] # noqa: ASYNC240
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]

# Create a semaphore to limit concurrent uploads to 60
semaphore = asyncio.Semaphore(SMOKESHOW_MAX_CONCURRENT_UPLOADS)
Expand Down Expand Up @@ -105,7 +105,7 @@ async def _upload_file(
upload_root: str,
file_path: Path,
rel_path: Path,
timeout: int, # noqa: ASYNC109
timeout: int, # ruff:ignore[async-function-with-timeout]
) -> None:
"""Upload a single file to smokeshow."""
url_path = str(rel_path)
Expand All @@ -119,7 +119,7 @@ async def _upload_file(
try:
response = await client.post(
upload_root + url_path,
content=file_path.read_bytes(), # noqa: ASYNC240
content=file_path.read_bytes(), # ruff:ignore[blocking-path-method-in-async-function]
headers=headers,
timeout=timeout,
)
Expand Down
72 changes: 36 additions & 36 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ default-groups = ["dev"]
[dependency-groups]
dev = [
"pytest>=9.0.2",
"ruff==0.15.21",
"ruff==0.15.22",
"ty==0.0.62",
"mypy==2.3.0",
"watchdog",
Expand Down Expand Up @@ -81,40 +81,40 @@ ignore = [
"DOC", # Checks for correct docstring format.
"FBT", # Checks for Boolean-typed positional argument in function definition.
# Ignored rules (sorted alphabetically):
"ANN401", # Allow Any type in annotations.
"COM812", # Trailing comma missing. Not recommended with formatter.
"COM819", # Trailing comma prohibited. Not recommended with formatter.
"D100", # Missing docstring in public module.
"D101", # Missing docstring in public class.
"D103", # Missing docstring in public function.
"D104", # Missing docstring in public package.
"D107", # Missing docstring in __init__.
"E501", # Line too long. Ignored for user-facing strings and help text.
"ERA001", # Commented out code.
"FIX002", # Disallow TODO comments.
"FURB152", # Math constants should use math module.
"PLC0415", # Imports not at top-level.
"PLC2701", # Import of private name.
"PLR0904", # Too many public methods.
"PLR0911", # Too many return statements.
"PLR0912", # Too many branches.
"PLR0913", # Too many arguments.
"PLR0914", # Too many local variables.
"PLR0915", # Too many statements.
"PLR0916", # Too many boolean expressions.
"PLR0917", # Too many positional arguments.
"PLR1702", # Too many nested blocks.
"PLR2004", # Magic value used in comparison.
"PLR6301", # Method could be function (no self usage).
"PLW0717", # Too many statements in try clause.
"RET504", # Unnecessary assignment before return.
"RUF052", # Dummy variable accessed.
"RUF067", # Non-empty __init__ module.
"SIM117", # Multiple with statements should be combined.
"T201", # Print statement found.
"TD002", # Missing author in TODO.
"TD003", # Missing issue link in TODO.
"TRY300", # Consider else block instead of return in try.
"any-type", # Allow Any type in annotations.
"missing-trailing-comma", # Trailing comma missing. Not recommended with formatter.
"prohibited-trailing-comma", # Trailing comma prohibited. Not recommended with formatter.
"undocumented-public-module", # Missing docstring in public module.
"undocumented-public-class", # Missing docstring in public class.
"undocumented-public-function", # Missing docstring in public function.
"undocumented-public-package", # Missing docstring in public package.
"undocumented-public-init", # Missing docstring in __init__.
"line-too-long", # Line too long. Ignored for user-facing strings and help text.
"commented-out-code", # Commented out code.
"line-contains-todo", # Disallow TODO comments.
"math-constant", # Math constants should use math module.
"import-outside-top-level", # Imports not at top-level.
"import-private-name", # Import of private name.
"too-many-public-methods", # Too many public methods.
"too-many-return-statements", # Too many return statements.
"too-many-branches", # Too many branches.
"too-many-arguments", # Too many arguments.
"too-many-locals", # Too many local variables.
"too-many-statements", # Too many statements.
"too-many-boolean-expressions", # Too many boolean expressions.
"too-many-positional-arguments", # Too many positional arguments.
"too-many-nested-blocks", # Too many nested blocks.
"magic-value-comparison", # Magic value used in comparison.
"no-self-use", # Method could be function (no self usage).
"too-many-statements-in-try-clause", # Too many statements in try clause.
"unnecessary-assign", # Unnecessary assignment before return.
"used-dummy-variable", # Dummy variable accessed.
"non-empty-init-module", # Non-empty __init__ module.
"multiple-with-statements", # Multiple with statements should be combined.
"print", # Print statement found.
"missing-todo-author", # Missing author in TODO.
"missing-todo-link", # Missing issue link in TODO.
"try-consider-else", # Consider else block instead of return in try.
]

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

[tool.ruff.lint.isort]
known-first-party = ["app"]
Expand Down
Loading