Skip to content

Commit

Permalink
ci,tools: improve the precision of report-missing-fn-doc, remove depe…
Browse files Browse the repository at this point in the history
…ndence on sed
  • Loading branch information
spytheman committed Feb 8, 2022
1 parent ff02f94 commit 1dbde05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/docs_ci.yml
Expand Up @@ -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
Expand All @@ -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
1 change: 0 additions & 1 deletion cmd/tools/missdoc.v
Expand Up @@ -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)
Expand Down

0 comments on commit 1dbde05

Please sign in to comment.