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

Added assertion section to document assertions #276

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ test_*
.vscode/settings.json
*.psd
todo
autodocstring-*.vsix
autodocstring*.vsix
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ vsc-extension-quickstart.md
**/tslint.json
**/*.map
**/*.ts
**/*.vsix
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

[All Changes](https://github.com/NilsJPWerner/autoDocstring/compare/v0.6.1...master)

## [0.6.4](https://github.com/sunipkm/autoDocstring/tree/v0.6.4) - 2024-03-11
- Added the `google-assert` style file and made it default.
- `google-assert` adds markdown for subgroups (e.g. args, returns) as Heading 3, and lists arguments, returns etc.
- Assertions now support statements starting with parenthesis.

## [0.6.1](https://github.com/NilsJPWerner/autoDocstring/tree/v0.6.1) - 2022-02-15

- Rename oneline-rst to one-line-sphinx
Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/njpwerner.autodocstring.svg)](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring)
[![Rating](https://vsmarketplacebadge.apphb.com/rating-short/njpwerner.autodocstring.svg)](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring&ssr=false#review-details)
[![Build Status](https://github.com/NilsJPWerner/autoDocstring/actions/workflows/test_and_publish.yml/badge.svg)](https://github.com/NilsJPWerner/autoDocstring/actions/workflows/test_and_publish.yml)
[![Github Sponsorship](https://img.shields.io/badge/sponsor-5A5A5A?style=flat&logo=GitHub-Sponsors)](https://github.com/sponsors/NilsJPWerner)

# autoDocstring: VSCode Python Docstring Generator
# autoDocstringPy: A fork of autoDocstring, the VSCode Python Docstring Generator

Visual Studio Code extension to quickly generate docstrings for python functions.
This is a fork of the [autoDocstring](https://github.com/NilsJPWerner/autoDocstring) since the original does not appear to be accepting
pull requests, and I really wanted to document `assert` statements used in Python functions.


![Auto Generate Docstrings](images/demo.gif)

Expand Down Expand Up @@ -52,7 +50,7 @@ This extension contributes the following settings:

## Custom Docstring Templates

This extension now supports custom templates. The extension uses the [mustache.js](https://github.com/janl/mustache.js/) templating engine. To use a custom template create a .mustache file and specify its path using the `customTemplatePath` configuration. View the included google docstring [template](src/docstring/templates/google.mustache) for a usage example. The following tags are available for use in custom templates.
This extension now supports custom templates. The extension uses the [mustache.js](https://github.com/janl/mustache.js/) templating engine. To use a custom template create a `.mustache` file and specify its path using the `customTemplatePath` configuration. View the included google docstring [template](src/docstring/templates/google.mustache) for a usage example. The following tags are available for use in custom templates.

### Variables

Expand Down Expand Up @@ -83,6 +81,10 @@ This extension now supports custom templates. The extension uses the [mustache.j
{{descriptionPlaceholder}} - _description_ placeholder
{{/exceptions}}

{{#assertions}} - iterate over assertions
{{stmt}} - assertion statement
{{/assertions}}

{{#yields}} - iterate over yields
{{typePlaceholder}} - _type_ placeholder
{{descriptionPlaceholder}} - _description_ placeholder
Expand All @@ -109,6 +111,9 @@ This extension now supports custom templates. The extension uses the [mustache.j
{{#exceptionsExist}} - display contents if exceptions exist
{{/exceptionsExist}}

{{#assertionsExist}} - display contents if assertions exist
{{/assertionsExist}}

{{#yieldsExist}} - display contents if returns exist
{{/yieldsExist}}

Expand All @@ -125,13 +130,13 @@ Check the [CHANGELOG.md](CHANGELOG.md) for any version changes.

## Reporting issues

Report any issues on the github [issues](https://github.com/NilsJPWerner/autoDocstring/issues) page. Follow the template and add as much information as possible.
Report any issues on the github [issues](https://github.com/sunipkm/autoDocstring/issues) page. Follow the template and add as much information as possible.

## Contributing

The source code for this extension is hosted on [GitHub](https://github.com/NilsJPWerner/autoDocstring). Contributions, pull requests, suggestions, and bug reports are greatly appreciated.
The source code for this extension is hosted on [GitHub](https://github.com/sunipkm/autoDocstringPy). Contributions, pull requests, suggestions, and bug reports are greatly appreciated.

- Post any issues and suggestions to the github [issues page](https://github.com/NilsJPWerner/autoDocstring/issues). Add the `feature request` tag to any feature requests or suggestions.
- Post any issues and suggestions to the github [issues page](https://github.com/sunipkm/autoDocstring/issues). 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.

Expand Down
Binary file modified images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading