From 9fcef5030accbb4430abe7c8ae4becba089d0f45 Mon Sep 17 00:00:00 2001 From: "Eric N. Vander Weele" Date: Sun, 14 Oct 2018 20:19:03 -0400 Subject: [PATCH] autodoc: Respect `member-order` in `autodoc_default_options` as documented In the `autodoc_default_options` documentation, it mentions that `member-order` is respected; however, when setting the key-value pair in `conf.py`, it is not. Thus, add `member-order` as one of the default options respected in `conf.py`. Additionally, update the list of supported options to match the example. --- doc/usage/extensions/autodoc.rst | 7 ++++--- sphinx/ext/autodoc/directive.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index e604cad28..80783301e 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -383,9 +383,10 @@ There are also new config values that you can set: Setting ``None`` is equivalent to giving the option name in the list format (i.e. it means "yes/true/on"). - The supported options are ``'members'``, ``'undoc-members'``, - ``'private-members'``, ``'special-members'``, ``'inherited-members'``, - ``'show-inheritance'``, ``'ignore-module-all'`` and ``'exclude-members'``. + The supported options are ``'members'``, ``'member-order'``, + ``'undoc-members'``, ``'private-members'``, ``'special-members'``, + ``'inherited-members'``, ``'show-inheritance'``, ``'ignore-module-all'`` and + ``'exclude-members'``. .. versionadded:: 1.8 diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index e831cab64..cf1f2f47f 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -31,7 +31,7 @@ logger = logging.getLogger(__name__) # common option names for autodoc directives AUTODOC_DEFAULT_OPTIONS = ['members', 'undoc-members', 'inherited-members', 'show-inheritance', 'private-members', 'special-members', - 'ignore-module-all', 'exclude-members'] + 'ignore-module-all', 'exclude-members', 'member-order'] class DummyOptionSpec: