Repository navigation
Show the error level on issue pages - #157
Merged
Merged
Conversation
alies-dev
force-pushed
the
alies-dev/issue-level-badges
branch
from
November 24, 2026 14:16
64a8890 to
56139dd
Compare
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.
Context
Issue pages such as DuplicateEnumCase don't say at which error levels the issue is an error. To learn whether
RedundantConditionfails a project aterrorLevel="3", you have to find it on the error levels page. And no page says whichpsalm.xmlsetting turns on feature-specific issues such asTaintedSqlorUnusedMethod.Refs #0
Solution
Every issue page now shows badges under its title, in the style of php.watch's split pills:
RedundantCondition(level 4)Error at levels | 1–4Default (2) | ErrorMixedAssignment(level 1)Error at levels | 1 onlyDefault (2) | InfoDuplicateEnumCase(always an error)Error at levels | AllTaintedSql(feature-specific)Error at levels | AllConfig | runTaintAnalysisEach badge links to the issue's section of the error levels page and has a tooltip with the details (for
Config: the default and the CLI flag, where there is one).At build time, the theme takes the level from the heading the issue is listed under in
running_psalm/error_levels.md. Psalm generates that page from each issue'sERROR_LEVEL, and its tests check that every issue is under the right heading, so the badges agree with the page they link to, and a new or moved issue needs no change here. TheConfigattribute is not in any Psalm doc, so it is a list intheme/partials/issue-level.html, and a new feature-specific issue needs an entry there to get aConfigbadge.UnevaluatedCodehas none on purpose: Psalm reports it with and without unused-variable detection.It is only a theme override, with no plugin or hook, so it works with the server's mkdocs 1.1 and mkdocs-material 4.6.3. I built the docs with those versions: all 341 issue pages get badges (
PluginIssuehas no level and gets none). The badges go into the samecontentblock as the newsletter form, which stays under every page.The colours and sizes are CSS custom properties on
.psalm-level, and each kind of pill only overrides--pill-*. Rebuildingmkdocs_material_extra.csswith the local webpack reformats the whole file, so I added only the compiled badge rules to the committed file.