ci,tools: improve the precision of report-missing-fn-doc, remove dependence on sed

pull/13405/head
Delyan Angelov 2022-02-08 11:28:50 +02:00
parent ff02f94fd6
commit 1dbde05267
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 7 additions and 6 deletions

View File

@ -14,12 +14,14 @@ jobs:
run: make
- name: Check markdown line length & code examples
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.
## 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
env:
MOPTIONS: --no-line-numbers --relative-paths --exclude /vlib/v/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/ vlib/
steps:
- uses: actions/checkout@v2
- name: Build V
@ -33,14 +35,14 @@ jobs:
- name: Check against parent commit
run: |
./v run cmd/tools/missdoc.v --no-line-numbers vlib/ | sed -n 's@^.*/vlib/@vlib/@p' | sort > /tmp/n_v.txt
./v run cmd/tools/missdoc.v --no-line-numbers pv/vlib/ | sed -n 's@^.*/vlib/@vlib/@p' | sort > /tmp/o_v.txt
./v run cmd/tools/missdoc.v $MOPTIONS | sort > /tmp/n_v.txt
cd pv/ && ../v run ../cmd/tools/missdoc.v $MOPTIONS | 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:"
echo "The following $((count_new-count_old)) function(s) are introduced with no documentation:"
diff /tmp/n_v.txt /tmp/o_v.txt ## diff does exit(1) when files are different
fi

View File

@ -158,7 +158,6 @@ fn main() {
exclude: fp.string_multi('exclude', `e`, '')
relative_paths: fp.bool('relative-paths', `r`, false, 'Use relative paths in output.')
}
dump(opt)
if opt.show_help {
println(fp.usage())
exit(0)