scripts: cover .tsx in the tracker-tag and comment-block lints

This commit is contained in:
damocles 2026-08-11 21:01:26 +02:00
commit 79dc8ca615
2 changed files with 5 additions and 5 deletions

View file

@ -8,7 +8,7 @@
# exceeds MAX. Runs as its own CI job and IS a required check on the forge
# (branch protection) — a hit blocks merge.
#
# Scope: tracked *.rs *.nix *.sh *.js *.ts *.css *.html. Markdown is exempt
# Scope: tracked *.rs *.nix *.sh *.js *.ts *.tsx *.css *.html. Markdown is exempt
# (it is prose by nature). Comment forms: `#` line comments (nix/sh), `//`
# line comments (rs/js/ts), and `/* */` block comments (nix/rs/js/ts/css) +
# `<!-- -->` (html). A blank line separates two line-comment blocks (does NOT
@ -23,12 +23,12 @@ MAX=30
# Collect annotations into a variable (not via xargs/awk exit codes) so a
# hit in any xargs batch is preserved — mirrors scripts/check-issue-refs.sh.
hits="$(
git ls-files -z '*.rs' '*.nix' '*.sh' '*.js' '*.ts' '*.css' '*.html' \
git ls-files -z '*.rs' '*.nix' '*.sh' '*.js' '*.ts' '*.tsx' '*.css' '*.html' \
| xargs -0 -r awk -v MAX="$MAX" '
function mode_of(fn) {
if (fn ~ /\.nix$/) return "nix"
if (fn ~ /\.sh$/) return "hash"
if (fn ~ /\.(rs|js|ts)$/) return "slash"
if (fn ~ /\.(rs|js|ts|tsx)$/) return "slash"
if (fn ~ /\.css$/) return "cstyle"
if (fn ~ /\.html$/) return "html"
return ""

View file

@ -8,7 +8,7 @@
# 0 otherwise. It runs as its own CI job and IS a required check on the
# forge (branch protection) — a hit blocks merge.
#
# Scope: tracked *.rs *.nix *.js *.ts *.css *.html. Markdown is exempt
# Scope: tracked *.rs *.nix *.js *.ts *.tsx *.css *.html. Markdown is exempt
# (prose docs may legitimately cite the tracker). The pattern matches a
# 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
@ -31,7 +31,7 @@ pattern='#[0-9]{2,5}([^0-9a-zA-Z]|$)'
# and an empty file list. Lines carrying the `lint:allow` marker are
# dropped (legitimate non-tracker `#<digits>`; see the header).
hits="$(
git ls-files -z '*.rs' '*.nix' '*.js' '*.ts' '*.css' '*.html' \
git ls-files -z '*.rs' '*.nix' '*.js' '*.ts' '*.tsx' '*.css' '*.html' \
| xargs -0 -r grep -nE "$pattern" /dev/null 2>/dev/null \
| grep -v 'lint:allow' || true
)"