Repository navigation
fix: resolve Ruff 0.16.0 lint/format violations - #169
Conversation
Migrate the lint/format CI workflow from chartboost/ruff-action@v1 to astral-sh/ruff-action@v3 and pin ruff to 0.16.0 for reproducible CI. Apply ruff check --fix and ruff format to resolve 0.16.0 lint/format violations (typing modernization, import sorting, formatting). Fixes ticket https://report.ostorlab.co/o/os/remediation/tickets/os-35977
There was a problem hiding this comment.
Code Review Summary
Total Issues Found: 1
Critical Issues: 0
Suggestions: 1
Key Findings:
The code review identified one minor style issue related to import formatting. Ruff's I001 auto-fix combined imports from the same module, which violates the project's convention of keeping imports on separate lines. No critical issues were found, and the overall code quality is good. It is recommended to revert the import change to separate lines and adjust Ruff's configuration (e.g., using noqa or updating [tool.ruff.lint.isort]) to prevent future auto-formatting violations.
|
|
||
| from agent import definitions | ||
| from agent import whatweb_utils | ||
| from agent import definitions, whatweb_utils |
There was a problem hiding this comment.
Style: The project's coding convention states: "Imports should be one-line per symbol and never be grouped from the same module." The original code correctly had these as two separate lines. Ruff's I001 auto-fix combined them, but this violates the convention. Please revert to separate import lines (from agent import definitions and from agent import whatweb_utils on separate lines). You may need to add a noqa: I001 comment or configure ruff's [tool.ruff.lint.isort] section with combine-as-imports = false / split-on-trailing-comma = true to prevent ruff from re-combining them on subsequent runs.
This PR resolves the Ruff 0.16.0 lint/format violations reported by CI for this agent, as part of ticket os-35977.
Changes
ruff check --fixandruff format(ruff 0.16.0); manually fixed the non-autofixableRUF059(renamed an unused unpacked variable to_kwargs). Behavior-preserving.Fixed rule codes (count)
Ticket os-35977 also asks to migrate
.github/workflows/lint_format_checker.yamlfromchartboost/ruff-action@v1toastral-sh/ruff-action@v3(pinversion: 0.16.0). This could not be pushed: the automation GitHub App token lacks theworkflowspermission, so GitHub rejects any push that modifies.github/workflows/*.yml.A maintainer with
workflowspermission must apply that workflow change separately.No blanket
noqa, per-file ignores, or rule additions were used. No behavior-affecting changes were made.Fixes ticket https://report.ostorlab.co/o/os/remediation/tickets/os-35977