NEO-29: enforce AAA markers in changed C# tests
Extend the pre-commit guard to fail when staged server test files lack explicit Arrange/Act/Assert markers, so AAA style compliance is checked automatically instead of relying on review memory.pull/54/head
parent
4dc9f76f79
commit
3a2fce2ce0
|
|
@ -43,3 +43,18 @@ if has_staged_match '^client/scripts/.*\.gd$'; then
|
|||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Enforce explicit AAA markers in changed C# test files.
|
||||
for f in "${staged_files[@]}"; do
|
||||
if [[ ! "$f" =~ ^server/NeonSprawl\.Server\.Tests/.*Tests\.cs$ ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ ! -f "$f" ]]; then
|
||||
continue
|
||||
fi
|
||||
if ! rg -q 'Arrange' "$f" || ! rg -q 'Act' "$f" || ! rg -q 'Assert' "$f"; then
|
||||
echo "pre-commit: $f is missing explicit AAA markers (Arrange/Act/Assert)." >&2
|
||||
echo "Add clear Arrange/Act/Assert sections in changed C# tests." >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in New Issue