autodoc: add 'exclude-members' to user global options

As the previous commit explains, it is now possible to specify arguments
to the global options in config files. This means that we can now include
the `exclude-members` option in this global configuration.

Previously, there was no point including this option because it makes no
sense without arguments. Including this option means users have the
flexibility of explicitly including which special methods they want using
(e.g.):

  :special-members: __init__, __iter__

or explicitly excluding which special-members (or other members) they want
using (e.g.):

  :exclude-members: __weakref__, __hash__
This commit is contained in:
Lewis Haley
2018-08-17 16:02:11 +01:00
parent 6e1e35c98a
commit f196a92055
3 changed files with 56 additions and 2 deletions

View File

@@ -341,7 +341,8 @@ There are also new config values that you can set:
This value is a list of autodoc directive flags that should be automatically
applied to all autodoc directives. The supported flags are ``'members'``,
``'undoc-members'``, ``'private-members'``, ``'special-members'``,
``'inherited-members'``, ``'show-inheritance'`` and ``'ignore-module-all'``.
``'inherited-members'``, ``'show-inheritance'``, ``'ignore-module-all'``
and ``'exclude-members'``.
If you set one of these flags in this config value, you can use a negated
form, :samp:`'no-{flag}'`, in an autodoc directive, to disable it once.
@@ -361,6 +362,7 @@ There are also new config values that you can set:
'member-order': 'bysource',
'special-members': '__init__',
'undoc-members': None,
'exclude-members': '__weakref__'
}
Setting ``None`` is equivalent to giving the option name in the list format