-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Options to document private/special methods #121
Conversation
18e3d32
to
a4191c5
Compare
Just rebased this. Failures are due to past sphinx versions not having |
I see that this pull request is fairly old but just wanted to say that I'd really appreciate this functionality. |
@ConorMacBride - would you mind rebasing the PR to check on how far it's from getting ready for review? |
Add config value to enable documenting private methods of a specific list of classes. Signed-off-by: Conor MacBride <conor@macbride.me>
Add config value to enable documenting special methods of a specific list of classes. Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
Signed-off-by: Conor MacBride <conor@macbride.me>
a4191c5
to
fe6154e
Compare
I rebased and added a commit to remove PyPI codecov, but that should be a separate PR. I don't like how these new options are configured. I think it would be better if the classes were set within the directives in the rst files, and not listed in |
Would you mind to open that separate PR for codecov, or shall I? I don't expect anything else failing on |
I've opened #163 to remove codecov. |
I had a quick look in the other open PRs, and wonder how this would be another approach for this same problem? #103 |
A global list of method names that begin with an underscore to document would work for me, yes. But, does #103 explicitly exclude the possibility of documenting |
yes, if Conor and og113 are happy with that as an alternative, we could close this one at merge time. |
Implements two new options for enabling the documenting of private and/or special methods. Only enabled for class names listed in config file. Class names must be given in full, e.g.,
module.submodule.classname
. These options are useful for including private/special methods of base classes in documentation intended for new developers. This helps a new developer quickly create a new subclass, which makes use of, or overrides, private methods in the base class.automodsumm_private_methods_of
Should be a list of fully qualified names of classes where all of its
private methods (i.e., method names beginning with an underscore, but
not ending with a double underscore) should be documented. Defaults to
[]
.automodsumm_special_methods_of
Should be a list of fully qualified names of classes where all of its
special methods (i.e., method names beginning with a double underscore and
ending with a double underscore) should be documented. Defaults to
[]
.Two new test cases are included, ensuring that each option only includes methods (either private or special) for the specified class names. Also ensures that the new options do not enable in the inclusion of extra private/special attributes.