Coder Social home page Coder Social logo

autodocstring's Introduction

Build Status Installs

VSCode autoDocstring

Visual Studio Code extension to quickly generate docstrings for python functions.

Auto Generate Docstrings

Features

  • Quickly generate a docstring snippet that can be tabbed through.
  • Choose between several different types of docstring formats.
  • Infers parameter types through pep484 type hints, default values, and var names.
  • Support for args, kwargs, decorators, errors, and parameter types

Docstring Formats

  • Default (docBlockr)
  • Google
  • Numpy
  • Sphinx
  • PyCharm
  • PEP0257 (coming soon)

Usage

Cursor must be on the line directly below the definition to generate full auto-populated docstring

  • Press enter after opening docstring with triple quotes (""" or ''')
  • Keyboard shortcut: ctrl+shift+2 or cmd+shift+2 for mac
    • Can be changed in Preferences -> Keyboard Shortcuts -> extension.generateDocstring
  • Command: Generate Docstring
  • Right click menu: Generate Docstring

Extension Settings

This extension contributes the following settings:

  • autoDocstring.docstringFormat: Switch between different docstring formats
  • autoDocstring.generateDocstringOnEnter: Generate the docstring on pressing enter after opening docstring
  • autoDocstring.includeDescription: Include description section in docstring
  • autoDocstring.includeName: Include function name at the start of docstring
  • autoDocstring.newlineBeforeSummary: New line before summary placeholder
  • autoDocstring.guessTypes: Infer types from type hints, default values and variable names

Known Issues

  • *args & **kwargs not dealt with properly
  • Extra new line at the end of inserted docstring
  • Inserted docstrings have trailing spaces (problem with how vscode deals with snippets)

Roadmap

  • Add support for classes and modules
  • Add more unit tests
  • Add Epytext format

Changelog

Check the CHANGELOG.md for any version changes.

Contributing

The source code for this extension is hosted on GitHub. Contributions, pull requests, suggestions, and bug reports are greatly appreciated.

  • Post any issues and suggestions to the github issues page. Add the feature request tag to any feature requests or suggestions.
  • To contribute, fork the project and then create a pull request back to master. Please update the README if you make any noticeable feature changes.
  • There is no official contribution guide or code of conduct yet, but please follow the standard open source norms and be respectful in any comments you make.

License

This project is licensed under the MIT License - see the LICENSE file for details

autodocstring's People

Contributors

nilsjpwerner avatar modelmat avatar cjonesy avatar md2perpe avatar chirieac avatar vblftepebwni6c avatar toonow avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.