scripts: cover .tsx in the tracker-tag and comment-block lints
This commit is contained in:
parent
44164d1a89
commit
79dc8ca615
2 changed files with 5 additions and 5 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
# exceeds MAX. Runs as its own CI job and IS a required check on the forge
|
# exceeds MAX. Runs as its own CI job and IS a required check on the forge
|
||||||
# (branch protection) — a hit blocks merge.
|
# (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), `//`
|
# (it is prose by nature). Comment forms: `#` line comments (nix/sh), `//`
|
||||||
# line comments (rs/js/ts), and `/* */` block comments (nix/rs/js/ts/css) +
|
# line comments (rs/js/ts), and `/* */` block comments (nix/rs/js/ts/css) +
|
||||||
# `<!-- -->` (html). A blank line separates two line-comment blocks (does NOT
|
# `<!-- -->` (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
|
# 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.
|
# hit in any xargs batch is preserved — mirrors scripts/check-issue-refs.sh.
|
||||||
hits="$(
|
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" '
|
| xargs -0 -r awk -v MAX="$MAX" '
|
||||||
function mode_of(fn) {
|
function mode_of(fn) {
|
||||||
if (fn ~ /\.nix$/) return "nix"
|
if (fn ~ /\.nix$/) return "nix"
|
||||||
if (fn ~ /\.sh$/) return "hash"
|
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 ~ /\.css$/) return "cstyle"
|
||||||
if (fn ~ /\.html$/) return "html"
|
if (fn ~ /\.html$/) return "html"
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
# 0 otherwise. It runs as its own CI job and IS a required check on the
|
# 0 otherwise. It runs as its own CI job and IS a required check on the
|
||||||
# forge (branch protection) — a hit blocks merge.
|
# 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
|
# (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
|
# 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
|
# 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
|
# and an empty file list. Lines carrying the `lint:allow` marker are
|
||||||
# dropped (legitimate non-tracker `#<digits>`; see the header).
|
# dropped (legitimate non-tracker `#<digits>`; see the header).
|
||||||
hits="$(
|
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 \
|
| xargs -0 -r grep -nE "$pattern" /dev/null 2>/dev/null \
|
||||||
| grep -v 'lint:allow' || true
|
| grep -v 'lint:allow' || true
|
||||||
)"
|
)"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue