From 909d5aa85d9f497da40bbf30088a192252d19713 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Mon, 9 Nov 2020 16:50:14 +0100 Subject: [PATCH] [doc] Change configuration to enforce autodoc options --- doc/conf.py | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index ac1169b..23be1f6 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -228,11 +228,11 @@ rst_epilog = """ # Default processing flags for sphinx autoclass_content = "class" autodoc_member_order = "bysource" -autodoc_default_flags = [ - "members", - "undoc-members", - "show-inheritance", -] +autodoc_default_options = { + "members": True, + "undoc-members": True, + "show-inheritance": True, + } if "BOB_DOCUMENTATION_SERVER" not in os.environ: # notice we need to overwrite this for BEAT projects - defaults from Bob are @@ -252,26 +252,3 @@ else: # Adds simplejson, pyzmq links intersphinx_mapping["http://simplejson.readthedocs.io/en/stable/"] = None intersphinx_mapping["http://pyzmq.readthedocs.io/en/stable/"] = None - -# We want to remove all private (i.e. _. or __.__) members -# that are not in the list of accepted functions -accepted_private_functions = ["__array__"] - - -def member_function_test(app, what, name, obj, skip, options): - # test if we have a private function - if len(name) > 1 and name[0] == "_": - # test if this private function should be allowed - if name not in accepted_private_functions: - # omit private functions that are not in the list of accepted private - # functions - return skip - else: - # test if the method is documented - if not hasattr(obj, "__doc__") or not obj.__doc__: - return skip - return False - - -def setup(app): - app.connect("autodoc-skip-member", member_function_test) -- GitLab