fix: resolve ruff and mypy lint errors
Metadata
Current evaluation
Merged after fixing ruff and mypy lint errors. Changes wrap implicit string concatenations, adjust test ignores for positional arguments, and correct type ignores and redundant casts. All CI checks passed and the change was approved.
Suggested action: —
No scores available.
Issue body
## Summary
Fixes the current lint failures from `make lint`:
- **ruff (ISC004)**: Wrapped implicitly concatenated strings in parentheses in `craft_providers/actions/snap_installer.py` and its corresponding test, so ruff doesn't flag them as possibly-missing commas.
- **ruff (PLR0917)**: Added `PLR0917` (too many positional arguments) to the existing test per-file-ignores list, alongside `PLR0913`, since test functions with many fixture parameters are expected and already allowed for the argument-count rule.
- **mypy**:
- `craft_providers/multipass/multipass.py`: added a `type: ignore[return-value]` for the generic `runner` callback branch, matching the existing ignore pattern already used on this function.
- `craft_providers/bases/ubuntu.py`: removed redundant `cast(str, ...)` calls in `BuilddBaseAlias.__lt__`/`__le__` (the `.value` is already inferred, so the casts were flagged as redundant) and wrapped the comparisons in `bool(...)` to satisfy mypy's `no-any-return` check.
## Testing
- `make lint-ruff` — passes
- `make lint-mypy` — passes
- `make lint-codespell` — passes
- `uv run pytest tests/unit/actions/test_snap_installer.py tests/unit/bases/test_ubuntu_buildd.py tests/unit/multipass/` — 667 passed
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after fixing ruff and mypy lint errors. Changes wrap implicit string concatenations, adjust test ignores for positional arguments, and correct type ignores and redundant casts. All CI checks passed and the change was approved. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
5
Confidence:
95
|
needs review | Resolves ruff and mypy lint errors by fixing string concatenation, updating ignore rules, and removing redundant type casts. Approved by one reviewer, all CI checks passing, and tests passing. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
5
Confidence:
95
|
needs review | Resolves ruff and mypy lint errors by fixing string concatenation, updating ignore rules, and removing redundant type casts. All CI checks pass, and the PR has one approval with zero unresolved comments. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
5
Confidence:
95
|
needs review | Fixes ruff and mypy lint errors by wrapping implicit string concatenations, updating ignore rules, and adjusting type annotations. All lint checks and tests pass. Currently approved by one reviewer with CI passing. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
5
Confidence:
90
|
needs review | Resolves ruff and mypy lint failures by fixing string concatenation, adding test ignores, and correcting type annotations. All CI checks pass, awaiting maintainer review. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
5
Confidence:
95
|
needs review | Resolves ruff and mypy lint errors by fixing implicit string concatenation, adjusting per-file ignores, and removing redundant type casts. All lint and unit tests pass. Currently awaiting maintainer review with CI checks passing or pending. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
5
Confidence:
95
|
needs review | Resolves ruff and mypy lint errors by wrapping concatenated strings, updating ignores, and removing redundant casts. Currently awaiting maintainer review with one failing lint CI check. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
10
Confidence:
90
|
needs review | Fixes ruff and mypy lint errors by wrapping strings, updating ignores, and adjusting type annotations. Lint and unit tests pass. Awaiting maintainer review with one CI job pending. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #33 lint: fix lint issues with newer ruff | craft-archives | merged | Merged to resolve linting failures introduced by a newer ruff version. Changes fix style checks across three files. Review approved, CI passed, and coverage remained unchanged. Additional unit tests were deferred to a separate tracking ticket. | |
| #408 style: fix linting for ruff 0.12 | starbase | merged | Merged a one-line update to resolve linting errors for ruff 0.12. Approved by two reviewers and passed all CI checks before integration. | |
| #901 style: fix ruff 0.13 linting issues | craft-application | merged | Merged after passing all CI checks and receiving approval from two reviewers. Resolves ruff 0.13 linting issues with a single-line change to one file. | |
| #1465 style: fix linting issues for newer ruff | craft-parts | merged | Merged after two approvals and passing all CI checks. Resolves linting compatibility issues with newer ruff versions, updating five files. | |
| #2229 style: fix linting errors | charmcraft | merged | Merged changes resolving linting errors from the latest ruff and pyright. Approved by two reviewers with zero unresolved comments. Updated 8 files, removing 22 lines overall. | |
| #173 tools: enable ruff | craft-cli | merged | Merged. Enabled ruff, removed pylint, and resolved associated linting, type-checking, and test coverage issues. Increased overall coverage by 0.08% and resolved issue #146. | |
| #68 lint: update ruff and fix linting | craft-archives | merged | Merged into main following reviewer approval and passing CI. Updates ruff configuration and resolves linting issues across four files, maintaining 100% diff coverage with no overall coverage change. | |
| #2819 fix(tests): resolve ruff lint failures in test suite | charmcraft | merged | Merged fix for four ruff lint failures in the test suite. Resolved PLR0917 errors by marking extra pytest parameters as keyword-only, and fixed ISC004 errors by parenthesizing implicit string concatenations. Lint and test checks now pass. | |
| #173 style: fix lint for ruff 0.12 | craft-archives | merged | Merged following two approvals and passing CI checks. Resolves lint compatibility for ruff 0.12 while preserving backwards compatibility with ruff 0.11. Applied via a minimal two-line adjustment. | |
| #4981 style(lint): fix ruff 0.6 linting errors | snapcraft | merged | Merged after receiving two approvals and passing CI checks. Resolves ruff 0.6 linting errors with a minimal one-file change. |