|
1 | 1 | # Copyright (c) 2025 Uwe Fechner |
2 | 2 | # SPDX-License-Identifier: BSD-3-Clause |
3 | 3 |
|
4 | | -# List all methods of VortexStepMethod |
5 | | -using VortexStepMethod |
| 4 | +# List all methods of VortexStepMethod and report if they are documented; |
| 5 | +# By default, also exported constants are reported |
| 6 | +using VortexStepMethod |
6 | 7 |
|
7 | 8 | exported_names = names(VortexStepMethod) |
8 | 9 | exported_functions = filter(n -> isdefined(VortexStepMethod, n) && isa(getfield(VortexStepMethod, n), Function), exported_names) |
9 | | -println("Exported methods:\n") |
10 | | -total = 0 |
11 | | -for fun in exported_functions |
12 | | - global total |
13 | | - f = getfield(VortexStepMethod, fun) |
14 | | - mes = methods(f) |
15 | | - for me in mes |
16 | | - println(split(repr(me),'@')[1]) |
17 | | - total += 1 |
| 10 | + |
| 11 | +function find_exported_functions(exported_functions) |
| 12 | + total = 0 |
| 13 | + for fun in exported_functions |
| 14 | + f = getfield(VortexStepMethod, fun) |
| 15 | + mes = methods(f) |
| 16 | + for me in mes |
| 17 | + println(split(repr(me),'@')[1]) |
| 18 | + total += 1 |
| 19 | + end |
18 | 20 | end |
| 21 | + return total |
19 | 22 | end |
| 23 | + |
| 24 | +println("Exported methods:\n") |
| 25 | +total = find_exported_functions(exported_functions) |
20 | 26 | println("\nTotal: $total") |
21 | 27 |
|
22 | | -function check_exported_docs(mod::Module) |
| 28 | +function check_exported_docs(mod::Module; only_functions=false) |
23 | 29 | exported_symbols = names(mod, all=false) |
24 | 30 | doc_status = Dict{Symbol,Bool}() |
25 | 31 | for sym in exported_symbols |
26 | | - #if isa(getfield(mod, sym), Function) |
27 | | - doc_status[sym] = Base.Docs.hasdoc(mod, sym) |
28 | | - #end |
| 32 | + if only_functions && !isa(getfield(mod, sym), Function) |
| 33 | + continue |
| 34 | + end |
| 35 | + doc_status[sym] = Base.Docs.hasdoc(mod, sym) |
29 | 36 | end |
30 | 37 | return doc_status |
31 | 38 | end |
|
0 commit comments