Skip to content

fix(linters): pass build_base to linters and avoid hardcoded fallback…#6272

Open
DRAKKKkk wants to merge 2 commits into
canonical:mainfrom
DRAKKKkk:fix-linter-build-base
Open

fix(linters): pass build_base to linters and avoid hardcoded fallback…#6272
DRAKKKkk wants to merge 2 commits into
canonical:mainfrom
DRAKKKkk:fix-linter-build-base

Conversation

@DRAKKKkk
Copy link
Copy Markdown

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.

  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • 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 if one was missing.
  • I've updated the relevant release notes.

@DRAKKKkk DRAKKKkk requested review from bepri and mr-cal as code owners May 30, 2026 08:26
@DRAKKKkk
Copy link
Copy Markdown
Author

DRAKKKkk commented Jun 1, 2026

"Hi @bepri and @mr-cal, I've submitted a fix for #6242.

The PR propagates the build_base parameter through the Linter base class and updates GpuLinter to prioritize it over the hardcoded fallback. I've also added test coverage for the fallback resolution logic, and all 146 tests are passing cleanly.

I look forward to your review and feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linters need access to the effective base

1 participant