ops: remove --self-test from attribution-trailer lint
Operator ruling on PR #4433: the self-test doubled the script size without adding value. Drops the --self-test mode + fixtures from check-attribution-trailers.sh and the CI self-test step that invoked it. The anchored trailer regex and the real BASE..HEAD scan are unchanged. Refs #4432
This commit is contained in:
parent
ed781b990e
commit
91320fdd80
2 changed files with 0 additions and 33 deletions
|
|
@ -53,8 +53,6 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: self-test
|
|
||||||
run: sh scripts/check-attribution-trailers.sh --self-test
|
|
||||||
- name: lint
|
- name: lint
|
||||||
run: sh scripts/check-attribution-trailers.sh
|
run: sh scripts/check-attribution-trailers.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,41 +12,10 @@
|
||||||
#
|
#
|
||||||
# Scope is the PR's commits (BASE..HEAD), not entire history — old commits
|
# Scope is the PR's commits (BASE..HEAD), not entire history — old commits
|
||||||
# must not fail the build.
|
# must not fail the build.
|
||||||
#
|
|
||||||
# Run with --self-test to check the pattern against fixtures instead of
|
|
||||||
# scanning git history.
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
trailer_re='^[[:space:]]*co-authored-by:.*(claude|anthropic|noreply@anthropic\.com)'
|
trailer_re='^[[:space:]]*co-authored-by:.*(claude|anthropic|noreply@anthropic\.com)'
|
||||||
|
|
||||||
if [ "${1:-}" = "--self-test" ]; then
|
|
||||||
fail=0
|
|
||||||
|
|
||||||
assert_match() {
|
|
||||||
if ! printf '%s\n' "$2" | grep -qiE "$trailer_re"; then
|
|
||||||
echo "self-test FAILED (expected match): $1" >&2
|
|
||||||
fail=1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
assert_no_match() {
|
|
||||||
if printf '%s\n' "$2" | grep -qiE "$trailer_re"; then
|
|
||||||
echo "self-test FAILED (expected no match): $1" >&2
|
|
||||||
fail=1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_match "bare trailer" 'Co-Authored-By: Claude'
|
|
||||||
assert_match "full trailer with email" 'Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>'
|
|
||||||
assert_match "lowercase trailer" 'co-authored-by: claude'
|
|
||||||
assert_no_match "ordinary message" 'fix: correct off-by-one in parser'
|
|
||||||
assert_no_match "prose mention of the trailer" 'ops: add CI lint for Co-Authored-By/Claude/Anthropic trailers'
|
|
||||||
|
|
||||||
if [ "$fail" -eq 0 ]; then
|
|
||||||
echo "self-test OK"
|
|
||||||
fi
|
|
||||||
exit "$fail"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${GITHUB_BASE_REF:-}" ]; then
|
if [ -n "${GITHUB_BASE_REF:-}" ]; then
|
||||||
base="origin/${GITHUB_BASE_REF}"
|
base="origin/${GITHUB_BASE_REF}"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue