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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
args: [--fix=lf] # repo standardises on LF endings (see .gitattributes)
exclude: '^THIRD_PARTY_NOTICES\.txt$'

# Python: lint + format the helper scripts and engine workers.
# Python: lint + format every Python file in the repository.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.3
hooks:
Expand Down
7 changes: 0 additions & 7 deletions docs/rocm-docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,3 @@ def filter(self, record: logging.LogRecord) -> bool:
"sphinx_design",
]
exclude_patterns = []

# -- Sphinx setup ----------------------------------------------------------


def setup(app):
"""Sphinx setup"""
return {"parallel_read_safe": True, "parallel_write_safe": True}
39 changes: 38 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ruff configuration for the Python helper scripts (scripts/) and engine workers.
# Ruff configuration for every Python file in the repository.
# Formatting uses Ruff's defaults (88-column, double quotes), which the
# `ruff-format` pre-commit hook enforces.

Expand All @@ -15,7 +15,44 @@ select = [
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"RUF", # Ruff-specific rules
"ARG", # flake8-unused-arguments
"BLE", # flake8-blind-except
"SLF", # flake8-self (private-member access)
"PL", # Pylint (PLC/PLE/PLR/PLW)
]
ignore = [
"E501", # line length is enforced by the formatter; long comments/URLs are fine
#
# Pylint refactor metrics, ignored for every file: acting on them means
# restructuring existing scripts, which enabling the rule families does not do.
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
#
# Not a refactor metric: it flags inline numeric literals in comparisons, and
# replacing them with named constants is a separate cleanup.
"PLR2004", # magic-value-comparison
]

[lint.per-file-ignores]
# A waived rule checks nothing anywhere in that file, so new code in these files
# is reviewed by hand against the rule stated on the entry.
#
# A blind `except` must report the failure, fall back, or keep the error for a
# later message.
"scripts/comfyui_therock_gpu_test.py" = ["BLE001"] # blind-except
"scripts/therock_sdk_install_test.py" = ["BLE001"] # blind-except
"scripts/vllm_therock_gpu_test.py" = ["BLE001"] # blind-except
# Function-level imports belong to the self-test only; a module global rebound
# here is restored in a `finally`.
"scripts/vllm_route_check.py" = ["PLC0415", "PLW0603"] # import-outside-top-level + global-statement
# The skills/rocm-doctor/ entries stay waived rather than edited: a change there on
# main opens a "Bump rocm-doctor" pull request in amd/skills through its nightly
# workflow (see the `skills/rocm-doctor/` part of AGENTS.md).
#
# ARG001 covers only the unused `workspace` and `case` parameters of setup() and
# teardown(); any other unused argument in the file is removed. `_active` is the
# only module global the hooks rebind.
"skills/rocm-doctor/evals/hooks.py" = ["ARG001", "PLW0603"] # unused-function-argument + global-statement
# A `subprocess.run` here has its returncode asserted by the test.
"skills/rocm-doctor/evals/test_hooks.py" = ["PLW1510"] # subprocess-run-without-check
3 changes: 1 addition & 2 deletions scripts/local_assistant_therock_gpu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def main() -> int:
print_step(f"Copied ROCm runtime registry from {source_state}.")

localize_huggingface_cache(env, repo_root)
return run_live_acceptance(args, rocm, env, temp_state_root)
return run_live_acceptance(args, rocm, env)
finally:
if temp_state_root is not None and not args.keep_state:
print_step(f"Removing temporary ROCm CLI state under {temp_state_root}.")
Expand All @@ -79,7 +79,6 @@ def run_live_acceptance(
args: argparse.Namespace,
rocm: Path,
env: dict[str, str],
temp_state_root: Path | None,
) -> int:
data_dir = rocm_cli_data_dir(env)
service_id = args.service_id
Expand Down
Loading