fix(linters): pass build_base to linters and avoid hardcoded fallback…
Metadata
Current evaluation
Merged. Propagates the build_base parameter to linters and updates GpuLinter to use it instead of a hardcoded core24 fallback. Changes were approved by reviewers, CI passed, and the fix was integrated into main.
Suggested action: —
No scores available.
Issue body
Fixes #6242
## Description
Currently, linters only have access to the `base` key and not the `build-base`. This causes an issue in `GpuLinter`, where `"core24"` is hardcoded as a fallback if the base is `"bare"` or missing. This results in incorrect help URLs being generated for snaps that specify a different `build-base` (e.g., `"core26"`).
This PR:
1. Updates the `Linter` base class (`base.py`) and `run_linters` (`linters.py`) to accept and store the `build_base` parameter.
2. Updates `GpuLinter` (`gpu_linter.py`) to fall back to `self._build_base` before defaulting to `"core24"`.
3. Adds a unit test in `test_gpu_linter.py` to verify that `build-base` is correctly respected when `base` is `"bare"` or undefined.
### QA Steps / Local Testing
- All unit tests for linters (`pytest tests/unit/linters/`) have passed successfully (146 passed).
- Code formatting and style checks (`ruff format`, `ruff check`) passed cleanly.
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [x] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [ ] I've updated the relevant release notes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Propagates the build_base parameter to linters and updates GpuLinter to use it instead of a hardcoded core24 fallback. Changes were approved by reviewers, CI passed, and the fix was integrated into main. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
10
Complexity:
20
Confidence:
85
|
needs review | Updates linters to accept and use build_base instead of hardcoding core24 fallback. Addresses review feedback, fixes tests, and is synced with main. Currently awaiting maintainer review and CI workflow approval. |
Update history
No update history recorded yet.
Related issues
No related issues found above the similarity threshold.