Repository navigation
checker: recognize table<...>/bare table as a table-shaped alternative - #22
Merged
Merged
Conversation
_has_table_alternative only checked for "{" or "HL." in a type
expression - missing LuaLS's generic table<K, V> syntax and the bare
"table" alternative entirely (e.g. HL.LayerRuleSpec.match: table<string,
string|boolean>, or config keys typed integer|table). Every real layer
rule with a match table was a false positive.
Found by running check against two independent real-world Hyprland Lua
configs - Garuda Linux's distribution-shipped settings
(garuda-hyprland-settings) and the sea-shell project - both of which
hit this identically, since a match table is the only way to write a
layer rule at all.
The same run surfaced a second, genuinely upstream gap, not a
hyprvalidate bug: both configs also use hl.bind(..., { mouse = true }),
and `mouse` isn't in HL.BindOptions. Traced into Hyprland's own source:
mouse is a real, implemented flag (LuaKeybind.cpp, parsed identically
to click/drag, which ARE in the schema) missing - along with
auto_consuming, device_inclusive, and devices - from a hand-written
field list in Hyprland's own meta/generateLuaStubs.py. Not fixable
here without hand-maintaining the same kind of table this project
exists to avoid; noted in CHANGELOG as an upstream-report candidate.
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.
Summary
Found by actually running
hyprvalidate checkagainst two independent, real-world, distribution/project-scale Hyprland Lua configs — not synthetic testing.Temerairerelease, announced 2026-08-19, reworked around Lua config)Both are real, public, unauthenticated-fetchable repos — verified directly, not taken on faith.
The bug (hyprvalidate's own)
_has_table_alternativeonly checked for{orHL.in a type expression to decide "is this a table shape, not a scalar." It missed LuaLS's generictable<K, V>syntax and the baretablealternative entirely.HL.LayerRuleSpec.matchis typedtable<string, string|boolean>— so every real layer rule with a match table was a false positive, in both configs identically, since a match table is the only way to write a layer rule at all (7 false positives in Garuda's config, 4 in sea-shell's).Fix:
_has_table_alternativenow also checks for"table"in the type expression. Verified: both real configs' layer-rule findings disappear completely; existing tests (including theHL.Gradienttable-alternative case) still pass.A second finding — upstream, not ours to fix
Both configs also use
hl.bind(..., { mouse = true }), flagged as'mouse' is not a field of HL.BindOptions. Traced directly into Hyprland's own source:mouseis a real, implemented flag (LuaKeybind.cpp, parsed identically toclick/drag, which are in the schema) — it's just missing, along withauto_consuming,device_inclusive, anddevices, from a hand-written field list in Hyprland's ownmeta/generateLuaStubs.py(lines ~658–677). That's the exact "hand-maintained table drifts from what's real" bug class this project exists to catch — just found one level further upstream. Not fixable here without hand-maintaining the same kind of table this project refuses to elsewhere. Noted in the CHANGELOG as a candidate for an upstream report — not filed yet, pending a decision on whether/how to do that.Test plan
pytest tests/— 205 passed (3 pre-existing/environmental entry-point failures unrelated, deselected)mousegap remains (2 findings, unchanged, correctly not something hyprvalidate can resolve)site/bundle.jsregenerated (checker.py changed)