Skip to content

Commit a50f8d5

Browse files
committed
tools: add support for v missdoc @vlib
1 parent 50a7d53 commit a50f8d5

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎cmd/tools/vmissdoc.v‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import flag
66

77
const tool_name = 'v missdoc'
88
const tool_version = '0.1.0'
9-
const tool_description = 'Prints all V functions in .v files under PATH/, that do not yet have documentation comments.'
9+
const tool_description = 'Prints all V functions in .v files under PATH/, that do not yet have documentation comments.\nNote: use `v missdoc @vlib`, to find public fns that still lack documentation.'
1010
const work_dir_prefix = normalise_path(os.real_path(os.wd_at_startup) + os.path_separator)
1111

1212
struct UndocumentedFN {
@@ -226,7 +226,6 @@ fn main() {
226226
fp.description(tool_description)
227227
fp.arguments_description('PATH [PATH]...')
228228
fp.skip_executable() // skip the "missdoc" command.
229-
230229
// Collect tool options
231230
mut opt := Options{
232231
show_help: fp.bool('help', `h`, false, 'Show this help text.')
@@ -240,9 +239,7 @@ fn main() {
240239
diff: fp.bool('diff', 0, false, 'exit(1) and show difference between two PATH inputs, return 0 otherwise.')
241240
verify: fp.bool('verify', 0, false, 'exit(1) if documentation is missing, 0 otherwise.')
242241
}
243-
244242
opt.additional_args = fp.finalize() or { panic(err) }
245-
246243
if opt.show_help {
247244
println(fp.usage())
248245
exit(0)
@@ -284,6 +281,11 @@ fn main() {
284281
}
285282
mut total := 0
286283
for path in opt.additional_args {
284+
if path in ['@vlib', '@cmd', '@examples'] {
285+
rpath := path[1..]
286+
total += opt.report_undocumented_functions_in_path(os.join_path(@VROOT, rpath))
287+
continue
288+
}
287289
if os.is_file(path) || os.is_dir(path) {
288290
total += opt.report_undocumented_functions_in_path(path)
289291
}

‎vlib/v/help/common/missdoc.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ between commits or branches:
3434
```
3535
v missdoc --diff current/code new/code
3636
```
37+
38+
Note: use `v missdoc @vlib`, to find public fns that still lack documentation.

0 commit comments

Comments
 (0)