Skip to content

Conversation

@kimt33
Copy link
Owner

@kimt33 kimt33 commented Jun 12, 2019

  1. Remove abstract methods make_docstring_numpy, make_docstring_google, and make_docstring_rst. These are replaced with a make_docstring that calls the appropriate method.
  2. Remove abstract class. Since the abstract methods are removed, there no reason to make DocContent into an abstract calss
  3. Remove default style in Docstring. This attribute seems to do nothing except for storing the default value for a keyword argument. Since Docstring will probably not be used directly by the user, we can move the default argument to somewhere else

Depends on PR #1

kimt33 added 8 commits June 9, 2019 15:51
This should make the protect against testing against the current directory
rather than the installed package
1. Add environment specifically for linters (black, pydocstring, import-order,
pep8 naming, bandit, flake8, pylint)
2. Add config for linters
3. Fix import orders
4. Fix missing docstring
5. Fix elif statements with raise statement
Branch was not getting covered because generator was not being exhausted. That's
not an issue because only the first entry is interesting
1. Remove DocContent.make_numpy_docstring, DocContent.make_google_docstring,
DocContent.make_rst_docstring
2. Add DocContent.make_docstring that calls the correct method for the given
style via name of the method
3. Change name of the methods from make_numpy_docstring to make_docstring_numpy,
from make_numpy_docstring_signature to make_docstring_numpy_signature, from
make_google_docstring to make_docstring_google, and from make_rst_docstring to
make_docstring_rst.

Having multiple abstract methods in DocSection for different styles of docstring
seems to get more complicated as the number of styles increases. If the goal is
to make it easier to create docstrings of new styles, then we can just add more
styles to the subclasses without having to add more functions at the base class.

I'm not 100% sure that the best way is to keep adding methods for each
style (this would result in the class growing quite quickly). Maybe it'd be
better to organize the modules by the styles also i.e. make a subclass for each
child of DocSection specific for the style.
1. Remove DocContent.__init__
2. Create Empty class for testing in the module rather than in test functions.

It seems that an abstract __init__ doesn't really do much except for preventing
any initialization. Though it does serve a purpose, it seems to complicate the
code more than it adds anything
1. Remove `default_style`
2. Format strings
3. Remove docstrings and tests for default_style

At the moment, it does not seem necessary to add an attribute does nothing
except to store the default value. This may be useful for making some porcelain
later, but it is not ncessary at the moment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants