-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add style check for doc comments #2575
Conversation
@@ -0,0 +1,16 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always try to use /bin/sh
after I caused a shell compatibility production incident 20 years ago.
However, we need bash features here and we know that CI provides bash so we are OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you insist on sh
(it's fine either way):
#!/bin/sh
out=$(grep -nr "^--- @" lua)
if [ "$out" ]; then
last_file=""
printf %s "$out" | while read -r line; do
file="$(echo "$line" | cut -d: -f1)"
if [ "$file" != "$last_file" ]; then
echo "$file:" >&2
last_file="$file"
fi
echo "$line" | awk -F: '{ printf(" line %s: %s\n", $2, $3) }' >&2
done
exit 1
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely, shellcheck is happy.
TIL print pipe into while
Edit: let's just go with bash; I'm being finicky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fails nicely.
shellcheck 👍
We're going to need to fix all these before we can merge: find lua -type f -exec sed -i 's/^--- @/---@/g' {} \;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI all passing now
Discussed in #2555 (comment)