From d83e1982209eb12999bd263289ff46940ed9188d Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 10 Jul 2021 01:26:52 +0200 Subject: [PATCH] docs: properly report typedefs that are missing in the doc --- docs/find-missing.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/find-missing.py b/docs/find-missing.py index 2ad2939993..a106d87984 100755 --- a/docs/find-missing.py +++ b/docs/find-missing.py @@ -144,6 +144,7 @@ for kind in python_decl: doxy_funs = {} # {classname: {func_name: [args]} } doxy_vars = {} # {classname: [names]} +doxy_type = {} # {classname: [names]} # find the declarations in the XML files for arg in xml_files: @@ -186,6 +187,10 @@ for arg in xml_files: if name not in doxy_funs[compoundname]: doxy_funs[compoundname][name] = [] doxy_funs[compoundname][name].append(args) + elif kind == "typedef": + if compoundname not in doxy_type: + doxy_type[compoundname] = [] + doxy_type[compoundname].append(name) elif kind == "friend": pass # Ignore friendship else: @@ -227,19 +232,47 @@ with os.popen('grep doxygenvariable:: find-missing.ignore source/*rst|sed \'s/^. print("Warning: {} documented, but class {} not found in doxygen.".format(line, klass)) continue if var not in doxy_vars[klass]: - print("Warning: Object {} documented but not found in {}".format(line, klass)) + print("Warning: Object {} documented but not found in '{}'".format(line, klass)) else: # print("Found {} in {}".format(line, klass)) doxy_vars[klass].remove(var) if len(doxy_vars[klass]) == 0: del doxy_vars[klass] +with os.popen('grep doxygentypedef:: find-missing.ignore source/*rst|sed \'s/^.*doxygentypedef:: //\'') as pse: + for line in (l.strip() for l in pse): + if '::' in line: + (klass, typ) = line.rsplit('::', 1) + else: + (klass, typ) = ('', line) + + if klass not in doxy_type: + print("Warning: {} documented, but class {} not found in doxygen.".format(line, klass)) + continue + if typ not in doxy_type[klass]: + print("Warning: Type {} documented but not found in '{}'".format(line, klass)) + else: +# print("Found {} in {}".format(line, klass)) + doxy_type[klass].remove(typ) + if len(doxy_type[klass]) == 0: + del doxy_type[klass] # Dump the undocumented Doxygen declarations for obj in sorted(doxy_funs): for meth in sorted(doxy_funs[obj]): for args in sorted(doxy_funs[obj][meth]): - print(".. doxygenfunction:: {}::{}{}".format(obj, meth, args)) + if obj is '': + print(".. doxygenfunction:: {}{}".format(meth, args)) + else: + print(".. doxygenfunction:: {}::{}{}".format(obj, meth, args)) for obj in doxy_vars: for meth in sorted(doxy_vars[obj]): print(".. doxygenvariable:: {}::{}".format(obj, meth)) + +for obj in doxy_type: + for meth in sorted(doxy_type[obj]): + if obj is '': + print(".. doxygentypedef:: {}".format(meth)) + else: + print(".. doxygentypedef:: {}::{}".format(obj, meth)) + \ No newline at end of file -- 2.20.1