feat(lint): add severityglyphs analyzer to keep the severity vocabulary in pkg/glyph - #1153
Draft
aparajon wants to merge 1 commit into
Draft
feat(lint): add severityglyphs analyzer to keep the severity vocabulary in pkg/glyph#1153aparajon wants to merge 1 commit into
aparajon wants to merge 1 commit into
Conversation
…ry in pkg/glyph Flags string literals containing a severity glyph (🚨 ⛔ ❌⚠️ ℹ️) in non-test source files and points at the pkg/glyph constant to use instead. The analyzer inspects decoded string values, so escape-spelled glyphs are caught, and it matches base codepoints so variation-selector variants are too. Test files are skipped: rendered-output assertions deliberately pin the literal glyphs so they break on vocabulary drift. Apply-state glyphs are a separate vocabulary and are not flagged. Wired into the pre-commit hook over staged packages (default + integration tags), excluding pkg/glyph and the analyzer's own glyph table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Adds a⚠️ ℹ️) in non-test source files, pointing at the
severityglyphsgo/analysis analyzer that flags string literals containing a severity glyph (🚨 ⛔ ❌pkg/glyphconstant to use instead. This is the enforcement piece of the severity-glyph vocabulary: with all rendering sites migrated, the analyzer keeps new code from reintroducing raw glyph literals that could drift surface by surface.❌) are caught the same as literal ones, and it matches base codepoints (⚠ U+26A0, ℹ U+2139) so variation-selector variants are caught too.pkg/presentationand are not flagged.webhookheaders):pkg/glyphand the analyzer's own glyph table are excluded. Wired into the pre-commit hook over staged packages with the same default + integration build-tag matrix ascloseandlog, plus acmd/severityglyphs-checkshim for standalone runs.The full repo passes under both tag flavors.
Analyzer output on a violation
Stacked on #1152; only the last commit is new here.
This PR was generated by Claude Code (Claude Fable 5).