Make three fail-open lints fail loudly
check-attribution-trailers.sh: the origin/main fallback now fails loudly if it cannot fetch/resolve origin/main, instead of silently substituting HEAD~10 as the diff base. check-comment-blocks.sh and check-issue-refs.sh: assert the tracked file-list search matched at least one file before treating an empty hit-set as clean, mirroring the existing assertion in check-doc-refs.sh. Refs 4442, fixes 4439
This commit is contained in:
parent
72bff26336
commit
dc0924627a
3 changed files with 24 additions and 1 deletions
|
|
@ -20,6 +20,16 @@ set -eu
|
|||
|
||||
MAX=30
|
||||
|
||||
# A lint whose file-list matches nothing passes forever while checking not
|
||||
# one file — mirrors the assertion in scripts/check-doc-refs.sh. If a rename
|
||||
# or extension-list edit silences `git ls-files` here, that is a failure of
|
||||
# this script, not a property of the tree.
|
||||
file_count="$(git ls-files '*.rs' '*.nix' '*.sh' '*.js' '*.mjs' '*.ts' '*.tsx' '*.css' '*.html' | wc -l)"
|
||||
if [ "$file_count" -eq 0 ]; then
|
||||
echo 'check-comment-blocks: file-list search matched nothing — pattern or tree changed' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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="$(
|
||||
|
|
|
|||
Loading…
Reference in a new issue