fix(linters): pass build_base to linters and avoid hardcoded fallback…#6272
Open
DRAKKKkk wants to merge 2 commits into
Open
fix(linters): pass build_base to linters and avoid hardcoded fallback…#6272DRAKKKkk wants to merge 2 commits into
DRAKKKkk wants to merge 2 commits into
Conversation
Author
|
"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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6242
Description
Currently, linters only have access to the
basekey and not thebuild-base. This causes an issue inGpuLinter, 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 differentbuild-base(e.g.,"core26").This PR:
Linterbase class (base.py) andrun_linters(linters.py) to accept and store thebuild_baseparameter.GpuLinter(gpu_linter.py) to fall back toself._build_basebefore defaulting to"core24".test_gpu_linter.pyto verify thatbuild-baseis correctly respected whenbaseis"bare"or undefined.QA Steps / Local Testing
pytest tests/unit/linters/) have passed successfully (146 passed).ruff format,ruff check) passed cleanly.make lint && make test.