Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Docstring missing 1 indentation Tab #13

Open
ovantur opened this issue Apr 14, 2023 · 6 comments
Open

Python Docstring missing 1 indentation Tab #13

ovantur opened this issue Apr 14, 2023 · 6 comments

Comments

@ovantur
Copy link

ovantur commented Apr 14, 2023

When using the plugin in PyCharm to docstring Python functions. The docstring generated will be missing 1 more tab for a proper view of docstring and also when generating docstring it un-indents the first line of code from the function to document being required that I indent that manually

@calum-bird
Copy link
Member

Thanks for sharing this! Could you please provide a code snippet to reproduce the issue?

@ovantur
Copy link
Author

ovantur commented Apr 19, 2023

Consider this init method inside a class. This is how docstring was generated and the line with super in bold is missing 1 indent

    def __init__(self, *args, **kwargs):
        """
    The __init__ function is called when the object is created.
    It sets up the initial state of the object.


    Parameters
    ----------
        self
            Represent the instance of the class
        *args
            Send a non-keyworded variable length argument list to the function
        **kwargs
            Pass a variable number of keyword arguments to a function

    Returns
    -------

        The original object

    Doc Author
    ----------
        Trelent
    """
    super(Hil, self).__init__(*args, **kwargs)
        self.__original_obj = copy.copy(self)
    How I would prefer the docstring is:
    def __init__(self, *args, **kwargs):
        """
        The __init__ function is called when the object is created.
        It sets up the initial state of the object.
    
    
        Parameters
        ----------
            self
                Represent the instance of the class
            *args
                Send a non-keyworded variable length argument list to the function
            **kwargs
                Pass a variable number of keyword arguments to a function
    
        Returns
        -------
    
            The original object
    
        Doc Author
        ----------
            Trelent
        """
        super(Hil, self).__init__(*args, **kwargs)
        self.__original_obj = copy.copy(self)

Anyway the missing indentation is most problematic because it generates errors and that line goes outside from function

@calum-bird
Copy link
Member

Great, thank you! We're on it.

@ajayjay0
Copy link

ajayjay0 commented Aug 4, 2023

As this extension appears to no longer be supported, could you perhaps mark it as such in the marketplace?

@calum-bird
Copy link
Member

calum-bird commented Aug 4, 2023

@ajayjay0 What version of what IDE is it not supported for?

@calum-bird
Copy link
Member

We're aware we aren't supported on 2023.2 yet. This does not mean that we do not intend to support it - just been busy.

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

No branches or pull requests

3 participants