[bug-yhg8dqypwmar] fix(check-naming): require scoped titles #10
@@ -73,9 +73,12 @@ The check validates four things for every non-break-glass Agent PR:
|
|||||||
Unknown roles, missing `bug-` segment, uppercase bug-ids, and empty
|
Unknown roles, missing `bug-` segment, uppercase bug-ids, and empty
|
||||||
kebab descriptions all produce a `FAIL[check-naming]` log line.
|
kebab descriptions all produce a `FAIL[check-naming]` log line.
|
||||||
|
|
||||||
2. **Title form** — for a `role/bug` branch the title must start with
|
2. **Title form** — for a `role/bug` branch the title must be
|
||||||
`[bug-<id>] `. For a `chore` branch the title must have no `[bug-id]`
|
`[bug-<id>] type(scope): description`. The type starts with a lowercase
|
||||||
prefix. If both carry a bug-id they must match.
|
letter and the type and one-component scope contain only lowercase letters,
|
||||||
|
digits, and hyphens. An optional `!` may follow the scope, and the description
|
||||||
|
must contain a non-whitespace character. For a `chore` branch the title must
|
||||||
|
have no `[bug-id]` prefix. If both carry a bug-id they must match.
|
||||||
|
|
||||||
3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal
|
3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal
|
||||||
`Fixes bug-<id>` automation token and the matching navigable
|
`Fixes bug-<id>` automation token and the matching navigable
|
||||||
|
|||||||
@@ -125,12 +125,12 @@ if [ "${BRANCH_KIND}" = "role-bug" ]; then
|
|||||||
if [ -z "${TITLE_BUG}" ]; then
|
if [ -z "${TITLE_BUG}" ]; then
|
||||||
echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]"
|
echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]"
|
||||||
echo " have: ${TITLE}"
|
echo " have: ${TITLE}"
|
||||||
echo " want: [${BRANCH_BUG}] ${TITLE}"
|
echo " want: [${BRANCH_BUG}] fix(scope): description"
|
||||||
FAILED=1
|
FAILED=1
|
||||||
elif [ "${TITLE_BUG}" != "${BRANCH_BUG}" ]; then
|
elif [ "${TITLE_BUG}" != "${BRANCH_BUG}" ]; then
|
||||||
echo "FAIL[check-naming]: bug-id mismatch — branch carries '${BRANCH_BUG}' but title carries '${TITLE_BUG}'"
|
echo "FAIL[check-naming]: bug-id mismatch — branch carries '${BRANCH_BUG}' but title carries '${TITLE_BUG}'"
|
||||||
FAILED=1
|
FAILED=1
|
||||||
elif ! printf '%s\n' "${TITLE}" | grep -qE "^\\[${BRANCH_BUG}\\] [a-z][a-z0-9-]*\\([a-z0-9][a-z0-9-]*\\)!?: .+"; then
|
elif ! printf '%s\n' "${TITLE}" | grep -qE "^\\[${BRANCH_BUG}\\] [a-z][a-z0-9-]*\\([a-z0-9][a-z0-9-]*\\)!?: .*[^[:space:]]$"; then
|
||||||
echo "FAIL[check-naming]: Bug-backed title must use '[${BRANCH_BUG}] type(scope): description'"
|
echo "FAIL[check-naming]: Bug-backed title must use '[${BRANCH_BUG}] type(scope): description'"
|
||||||
FAILED=1
|
FAILED=1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ check "role/bug Conventional title" 0 "dev/bug-x7k2m9/fix-resize" "[bug-
|
|||||||
check "role/bug plain title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] Fix resize" "dev"
|
check "role/bug plain title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] Fix resize" "dev"
|
||||||
check "role/bug missing scope" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix: fix resize" "dev"
|
check "role/bug missing scope" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix: fix resize" "dev"
|
||||||
check "role/bug path scope" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub/bugs): fix resize" "dev"
|
check "role/bug path scope" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub/bugs): fix resize" "dev"
|
||||||
|
check "role/bug empty description" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): " "dev"
|
||||||
|
check "role/bug whitespace description" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): " "dev"
|
||||||
check "chore Conventional title" 0 "chore/bump-deps" "chore(deps): bump deps" "dev"
|
check "chore Conventional title" 0 "chore/bump-deps" "chore(deps): bump deps" "dev"
|
||||||
|
|
||||||
# fail: invalid branch forms
|
# fail: invalid branch forms
|
||||||
|
|||||||
Reference in New Issue
Block a user