ci,tools: improve the precision of report-missing-fn-doc, remove dependence on sed
parent
ff02f94fd6
commit
1dbde05267
|
@ -14,12 +14,14 @@ jobs:
|
||||||
run: make
|
run: make
|
||||||
- name: Check markdown line length & code examples
|
- name: Check markdown line length & code examples
|
||||||
run: ./v check-md -hide-warnings .
|
run: ./v check-md -hide-warnings .
|
||||||
## NB: -hide-warnings is used here, so that the output is less noisy,
|
## NB: -hide-warnings is used here, so that the output is less noisy,
|
||||||
## thus real errors are easier to spot.
|
## thus real errors are easier to spot.
|
||||||
|
|
||||||
report-missing-fn-doc:
|
report-missing-fn-doc:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
env:
|
||||||
|
MOPTIONS: --no-line-numbers --relative-paths --exclude /vlib/v/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/ vlib/
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Build V
|
- name: Build V
|
||||||
|
@ -33,14 +35,14 @@ jobs:
|
||||||
|
|
||||||
- name: Check against parent commit
|
- name: Check against parent commit
|
||||||
run: |
|
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 $MOPTIONS | 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
|
cd pv/ && ../v run ../cmd/tools/missdoc.v $MOPTIONS | sort > /tmp/o_v.txt
|
||||||
count_new=$(cat /tmp/n_v.txt | wc -l)
|
count_new=$(cat /tmp/n_v.txt | wc -l)
|
||||||
count_old=$(cat /tmp/o_v.txt | wc -l)
|
count_old=$(cat /tmp/o_v.txt | wc -l)
|
||||||
echo "new pubs: $count_new | old pubs: $count_old"
|
echo "new pubs: $count_new | old pubs: $count_old"
|
||||||
echo "new head: $(head -n1 /tmp/n_v.txt)"
|
echo "new head: $(head -n1 /tmp/n_v.txt)"
|
||||||
echo "old head: $(head -n1 /tmp/o_v.txt)"
|
echo "old head: $(head -n1 /tmp/o_v.txt)"
|
||||||
if [[ ${count_new} -gt ${count_old} ]]; then
|
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
|
diff /tmp/n_v.txt /tmp/o_v.txt ## diff does exit(1) when files are different
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -158,7 +158,6 @@ fn main() {
|
||||||
exclude: fp.string_multi('exclude', `e`, '')
|
exclude: fp.string_multi('exclude', `e`, '')
|
||||||
relative_paths: fp.bool('relative-paths', `r`, false, 'Use relative paths in output.')
|
relative_paths: fp.bool('relative-paths', `r`, false, 'Use relative paths in output.')
|
||||||
}
|
}
|
||||||
dump(opt)
|
|
||||||
if opt.show_help {
|
if opt.show_help {
|
||||||
println(fp.usage())
|
println(fp.usage())
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
Loading…
Reference in New Issue