ehuss/Sublime-Wrap-Plus

Support for Googles Python Styleguide (multi level Subsequent Indents)

Opened this issue · 1 comments

raabf commented

It would also be nice if the plugin would support Googles Python Styleguide

A correctly formatted docstring after this guide should be look like this:

        """Short description of the Function.

        Args:
            first_arg (int): Description of the first argument. Lorem ipsum
                dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
                eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
                sed diam voluptua.
            second_arg (str, optional): Description if the second argument.
                Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
                diam nonumy eirmod tempor invidunt ut labore et dolore magna
                aliquyam erat, sed diam voluptua.

        Returns:
            Much Fun! Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
            sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
            aliquyam erat, sed diam voluptua.

        """

After ALT+Q in the Args: and the Returns: block, it becomes this:

        """Short description of the Function.

        Args: first_arg (int): Description of the first argument. Lorem ipsum
            dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
            tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
            voluptua. second_arg (str, optional): Description if the second
            argument. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
            sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
            aliquyam erat, sed diam voluptua.

        Returns: Much Fun! Lorem ipsum dolor sit amet, consetetur sadipscing
            elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
            magna aliquyam erat, sed diam voluptua.

        """

This form is very handy. The python docstring is intended be good human readable, which is the case in this style. But through doxypypy and napoleon it can correctly parsed by Doxygen and Sphinx. Therefore you can also use it for externally documenting your code.

Sublime-Wrap-Plus already has an Subsequent Indents feature. For this guide it is necessary that Sublime-Wrap-Plus also support that on multi level indents. For this style it is sufficient to only have an second level. I don't know if it is simpler/better to implement only a second level or generalize that and support all levels. Thanks :-)

Is there any movement on the issue? Maybe some workaround exists...