Sublime Forum

AutoDocstring: keep python docstrings up to date

#1

AutoDocstring [packagecontrol.io]

Announcing a plugin to help keep Python docstrings up to date. The goal of this plugin is to deal with formatting your docstring so that you can focus on content. In addition, you can rerun this plugin as arguments change so that keeping docstrings up to date requires very little extra brain power.

Source Available on Github

Features:

  • Inspects function definitions and inserts a stub for each parameter
  • Inspects class / module attributes and inserts a stub for each
  • Convert single docstrings or whole modules from one style to another with one command
  • Pull parameter and return type information from Python 3 annotations
  • Discovers what exceptions are raised in a function and inserts a stub for each
  • Rearranges parameters to reflect their order in the function definition
  • Automatically detects style: Google or Numpy

Usage:

Use cmd + alt + ' on OS X, or ctrl + alt + ' on Windows / Linux to update the function or class that proceeds the cursor.

Commands:

  • AutoDocstring: Current: Create or update the docstring for the next declaration that preceeds the cursor
  • AutoDocstring: All: Create or update docstrings for all declarations in a module
  • AutoDocstring: Convert...: Convert the docstring of the the next declaration that preceeds the cursor to a specific style
  • AutoDocstring: Convert All...: Convert all existing docstrings in a module to a specific style

Examples:

Inserting a new docstring…

Updating an existing docstring…

0 Likes

#2

Looks great!

0 Likes