← Back to issue list

fix: resolve ruff and mypy lint errors

View original Github issue

Metadata

Project
craft-providers
Number
#995
Type
pull request
State
merged
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR canonical/craft-providers#995 (commit 8112dd7) fixing ruff ISC004/PLR0917 and mypy errors in snap_installer, multipass and ubuntu bases; lint and test CI checks pass.

Resolution: closed resolved

Reason: The PR was merged into main as commit 8112dd7 ('fix: resolve ruff and mypy lint errors (#995)'), with all CI checks passing including 'lint / files'. It wrapped implicitly concatenated strings, added PLR0917 to test per-file ignores, and adjusted mypy ignores/casts in multipass.py and bases/ubuntu.py.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged PR canonical/craft-providers#995 (commit 8112dd7) fixing ruff ISC004/PLR0917 and mypy errors in snap_installer, multipass and ubuntu bases; lint and test CI checks pass.
stealth/space-bunny-alpha — closed resolved Merged canonical/craft-providers#995 (8112dd7), fixing Ruff ISC004/PLR0917 findings and mypy issues in snap installation, multipass, and Ubuntu base code.
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 work

  • Related To: canonical/craft-providers#1007 (confidence 55%)

    Later commit 232143d 'style: drop mypy, pyright (#1007)' removes the mypy linting that this PR adjusted, making its mypy fixes short-lived.

Related issues

Issue Project State Summary Similarity
#4602 build(lint): use ruff from snap snapcraft merged Merged PR #4602 (8a9a5c212) replaced pyright-based CI linting with Ruff supplied by its snap for more predictable tool upgrades.
72%
#146 style: fix linting errors for ruff 0.12 craft-platforms merged PR #146 merged in craft-platforms (commit fdad4a1) to fix ruff 0.12 lint errors: added # noqa: PLC0415 to lazy import in tests/conftest.py and ignored PLW1641 (eq-without-hash) in pyproject.toml.
72%
#173 tools: enable ruff craft-cli merged Merged PR #173 enabled Ruff, removed pylint, and fixed related mypy, pyright, test, and coverage issues; it explicitly fixes canonical/craft-cli#146.
71%
#901 style: fix ruff 0.13 linting issues craft-application merged Merged in canonical/craft-application#901 via commit 0a659742, fixing Ruff 0.13 linting with a one-line change; review was approved and all CI checks passed.
71%
#33 lint: fix lint issues with newer ruff craft-archives merged PR #33 merged as commit c2a6687, fixing new lint failures introduced by a newer Ruff release across3 files (+5/-3). Maintainer deferred extra unit tests to CRAFT-1641.
70%