Skip to content

Update docstring #45

Description

@asetGem

When the first version of a function takes some parameters, it generates the right docstring, that we just have to complete.
However, if we change the function by adding/removing parameter(s), and adding/removing a return, the docstring is not automatically updated.
The only solutions I found are:

  • either complete by myself, following the format generated
    Problem: must know the format rules (which is supposed to be simplified by using docblockr_python). For example, if there was no return in the function when we first generated the docstring, and now there is one, we have to check the format to know how to add our return value with its type and description.
  • or re-generate docstring, and then copy all descriptions/types of all parameters I already filled before
    Problem: time consuming... We are kind of writing the docstring twice...

It would be great if we could update the current docstring.

For now, hitting 'tab' after the starting """ generates a docstring.

What would be great:

  • When hitting 'tab', when there is already a docstring, generate an updated version of it (or do not change if nothing changed in function parameters/return of course...)
  • If a parameter is already in the docstring, then do nothing.
  • Otherwise, add it with default "description"/"type".

Do you think this could be possible?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions