ci: tighten tracker-tag lint to exclude digit-runs glued to a letter (#1555)
The tracker-tag lint's trailing class `[^0-9a-fA-F]` treated a non-hex letter as a valid terminator, so it flagged hash-route fragments like #24h / #1h (the stats-page window-selector routes) as tracker tags — four false positives in the frontend. A real tracker tag is never immediately followed by a letter, so widen the trailing class to [^0-9a-zA-Z]: still catches every real tag (followed by space / punctuation / EOL) while excluding any digit-run glued to a letter. Letter-bearing and 6-8-digit hex stay excluded as before. Also write theme.css's --crust fallback in six-digit form (#000 -> #000000) to dodge the one remaining pure-numeric-short-hex residual the lint documents. Pixel-identical colour. With both, the frontend tree contributes zero lint hits; only the legacy backlog (Rust) remains. Pattern + cases reviewed and approved by atlas on the issue.
This commit is contained in:
parent
5ef6a8b683
commit
d6aabcfe93
2 changed files with 7 additions and 5 deletions
|
|
@ -29,7 +29,7 @@
|
|||
a swap. Each is pixel-identical to its prior literal under the
|
||||
default palette: --crust is a darkened bg; --muted / --subtext0 are
|
||||
foreground↔background blends (two levels of dimmed text). */
|
||||
--crust: color-mix(in srgb, var(--base00) 58%, #000); /* terminal / code bg, below --bg */
|
||||
--crust: color-mix(in srgb, var(--base00) 58%, #000000); /* terminal / code bg, below --bg */
|
||||
--muted: color-mix(in srgb, var(--base05) 55.5%, var(--base00)); /* secondary / dimmed text */
|
||||
--subtext0: color-mix(in srgb, var(--base05) 77.7%, var(--base00)); /* toolbar/status text; dimmer than --fg, lighter than --muted */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,13 +13,15 @@
|
|||
#
|
||||
# Scope: tracked *.rs *.nix *.js *.ts *.css *.html. Markdown is exempt
|
||||
# (prose docs may legitimately cite the tracker). The pattern matches a
|
||||
# hash, 2-5 digits, then a non-hex char or end-of-line: that trailing
|
||||
# class skips CSS hex colours (letter-bearing or 6/8-digit) while still
|
||||
# catching tracker tags. Residual: a pure-numeric short hex (e.g. three
|
||||
# hash, 2-5 digits, then a non-alphanumeric char or end-of-line. A real
|
||||
# tracker tag is never glued to a letter, so the trailing class skips
|
||||
# both letter-bearing / 6-8-digit hex colours (the digit run breaks or
|
||||
# overruns) and digit-runs followed by a letter — e.g. hash-route
|
||||
# fragments like #24h. Residual: a pure-numeric short hex (e.g. three
|
||||
# identical digits) trips it — write the six-digit form to dodge.
|
||||
set -eu
|
||||
|
||||
pattern='#[0-9]{2,5}([^0-9a-fA-F]|$)'
|
||||
pattern='#[0-9]{2,5}([^0-9a-zA-Z]|$)'
|
||||
|
||||
# `/dev/null` forces grep to always print a filename prefix, even when
|
||||
# xargs hands it a single file. `-r`/`-0` keep it robust to odd paths
|
||||
|
|
|
|||
Loading…
Reference in a new issue