Skip to content

Commit

Permalink
ci: add style check for doc comments (#2575)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Courtis <[email protected]>
  • Loading branch information
Akmadan23 and alex-courtis authored Dec 9, 2023
1 parent 13f967f commit 2fed5e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ jobs:
version: "0.19"
args: --check lua

- name: doc-comments
run: ./scripts/doc-comments.sh
16 changes: 16 additions & 0 deletions scripts/doc-comments.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

out=$(grep -nr "^--- @" lua)

if [ "$out" ]; then
last_file=""
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 <<< "$out"
exit 1
fi

0 comments on commit 2fed5e1

Please sign in to comment.