test: add test checking proper admotion logic
This commit is contained in:
+24
-1
@@ -4,8 +4,31 @@
|
|||||||
# !!! <TYPE> "title" - Title needs to be quoted!
|
# !!! <TYPE> "title" - Title needs to be quoted!
|
||||||
# Same for ???
|
# Same for ???
|
||||||
grep -Er '^(!{3}|\?{3})\s\S+:|^(!{3}|\?{3})\s\S+\s[^"]' docs/*
|
grep -Er '^(!{3}|\?{3})\s\S+:|^(!{3}|\?{3})\s\S+\s[^"]' docs/*
|
||||||
|
format_issues=$?
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
failed=0
|
||||||
|
|
||||||
|
while read -r file; do
|
||||||
|
awk -v fname="$file" '
|
||||||
|
/^(!!!|\?\?\?)/ {
|
||||||
|
current_line_number = NR
|
||||||
|
current_line = $0
|
||||||
|
if (getline nextLine <= 0 || nextLine !~ /^ /) {
|
||||||
|
print "File:", fname
|
||||||
|
print "Error in Line ", current_line_number, "Expected next line to start with 4 spaces"
|
||||||
|
print ">>", current_line
|
||||||
|
print "------"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' "$file"
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
failed=1
|
||||||
|
fi
|
||||||
|
done < <(find . -type f -name "*.md")
|
||||||
|
|
||||||
|
if [ $format_issues -eq 1 ] && [ $failed -eq 0 ]; then
|
||||||
echo "Docs test success."
|
echo "Docs test success."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user