ci: add style check for doc comments (#2575)
Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
13f967f8e7
commit
2fed5e1010
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -40,3 +40,5 @@ jobs:
|
|||||||
version: "0.19"
|
version: "0.19"
|
||||||
args: --check lua
|
args: --check lua
|
||||||
|
|
||||||
|
- name: doc-comments
|
||||||
|
run: ./scripts/doc-comments.sh
|
||||||
|
|||||||
16
scripts/doc-comments.sh
Executable file
16
scripts/doc-comments.sh
Executable file
@ -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
|
||||||
Loading…
Reference in New Issue
Block a user