Skip to content

Commit 1dbde05

Browse files
committed
ci,tools: improve the precision of report-missing-fn-doc, remove dependence on sed
1 parent ff02f94 commit 1dbde05

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/docs_ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ jobs:
1414
run: make
1515
- name: Check markdown line length & code examples
1616
run: ./v check-md -hide-warnings .
17-
## NB: -hide-warnings is used here, so that the output is less noisy,
18-
## thus real errors are easier to spot.
17+
## NB: -hide-warnings is used here, so that the output is less noisy,
18+
## thus real errors are easier to spot.
1919

2020
report-missing-fn-doc:
2121
runs-on: ubuntu-20.04
2222
timeout-minutes: 5
23+
env:
24+
MOPTIONS: --no-line-numbers --relative-paths --exclude /vlib/v/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/ vlib/
2325
steps:
2426
- uses: actions/checkout@v2
2527
- name: Build V
@@ -33,14 +35,14 @@ jobs:
3335

3436
- name: Check against parent commit
3537
run: |
36-
./v run cmd/tools/missdoc.v --no-line-numbers vlib/ | sed -n 's@^.*/vlib/@vlib/@p' | sort > /tmp/n_v.txt
37-
./v run cmd/tools/missdoc.v --no-line-numbers pv/vlib/ | sed -n 's@^.*/vlib/@vlib/@p' | sort > /tmp/o_v.txt
38+
./v run cmd/tools/missdoc.v $MOPTIONS | sort > /tmp/n_v.txt
39+
cd pv/ && ../v run ../cmd/tools/missdoc.v $MOPTIONS | sort > /tmp/o_v.txt
3840
count_new=$(cat /tmp/n_v.txt | wc -l)
3941
count_old=$(cat /tmp/o_v.txt | wc -l)
4042
echo "new pubs: $count_new | old pubs: $count_old"
4143
echo "new head: $(head -n1 /tmp/n_v.txt)"
4244
echo "old head: $(head -n1 /tmp/o_v.txt)"
4345
if [[ ${count_new} -gt ${count_old} ]]; then
44-
echo "The following $((count_new-count_old)) function(s) is introduced with no documentation:"
46+
echo "The following $((count_new-count_old)) function(s) are introduced with no documentation:"
4547
diff /tmp/n_v.txt /tmp/o_v.txt ## diff does exit(1) when files are different
4648
fi

cmd/tools/missdoc.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ fn main() {
158158
exclude: fp.string_multi('exclude', `e`, '')
159159
relative_paths: fp.bool('relative-paths', `r`, false, 'Use relative paths in output.')
160160
}
161-
dump(opt)
162161
if opt.show_help {
163162
println(fp.usage())
164163
exit(0)

0 commit comments

Comments
 (0)