|
| 1 | +# Copyright (c) 2025 Uwe Fechner |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | + |
| 4 | +# List all methods of VortexStepMethod and report if they are documented; |
| 5 | +# By default, also exported constants are reported |
| 6 | +using VortexStepMethod |
| 7 | + |
| 8 | +exported_names = names(VortexStepMethod) |
| 9 | +exported_functions = filter(n -> isdefined(VortexStepMethod, n) && isa(getfield(VortexStepMethod, n), Function), exported_names) |
| 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(me.sig) |
| 18 | + total += 1 |
| 19 | + end |
| 20 | + end |
| 21 | + return total |
| 22 | +end |
| 23 | + |
| 24 | +println("Exported methods:\n") |
| 25 | +total = find_exported_functions(exported_functions) |
| 26 | +println("\nTotal: $total") |
| 27 | + |
| 28 | +function check_exported_docs(mod::Module; only_functions=false) |
| 29 | + exported_symbols = names(mod, all=false) |
| 30 | + doc_status = Dict{Symbol,Bool}() |
| 31 | + for sym in exported_symbols |
| 32 | + val = getfield(mod, sym) |
| 33 | + if only_functions && !isa(val, Function) |
| 34 | + continue |
| 35 | + end |
| 36 | + doc_status[sym] = Base.Docs.hasdoc(mod, sym) |
| 37 | + end |
| 38 | + return doc_status |
| 39 | +end |
| 40 | + |
| 41 | +# Main execution block: |
| 42 | +results = check_exported_docs(VortexStepMethod) |
| 43 | +undocumented = filter(kv -> !kv[2], results) |
| 44 | +println("\nUndocumented exported symbols: \n", keys(undocumented)) |
0 commit comments