1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: add report-missing-fn-doc job, to prevent adding new undocumented pub symbols in vlib (#13386)

This commit is contained in:
Larpon 2022-02-06 18:52:14 +01:00 committed by GitHub
parent d46ac40758
commit 649ecab11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,3 +16,31 @@ jobs:
run: ./v check-md -hide-warnings .
## NB: -hide-warnings is used here, so that the output is less noisy,
## thus real errors are easier to spot.
report-missing-fn-doc:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- name: Build V
run: make
- name: Checkout previous v
uses: actions/checkout@v2
with:
repository: vlang/v
path: pv
- name: Check against parent commit
run: |
./v run cmd/tools/missdoc.v vlib/ | sed -n 's@^.*/vlib/@vlib/@p' | sort > /tmp/n_v.txt
./v run cmd/tools/missdoc.v pv/vlib/ | sed -n 's@^.*/vlib/@vlib/@p' | sort > /tmp/o_v.txt
count_new=$(cat /tmp/n_v.txt | wc -l)
count_old=$(cat /tmp/o_v.txt | wc -l)
echo "new pubs: $count_new | old pubs: $count_old"
echo "new head: $(head -n1 /tmp/n_v.txt)"
echo "old head: $(head -n1 /tmp/o_v.txt)"
if [[ ${count_new} -gt ${count_old} ]]; then
echo "The following $((count_new-count_old)) function(s) is introduced with no documentation:"
diff /tmp/n_v.txt /tmp/o_v.txt ## diff does exit(1) when files are different
fi