autoDocstring icon indicating copy to clipboard operation
autoDocstring copied to clipboard

Add option to remove exceptions raised from top-level docstrings

Open HitLuca opened this issue 4 years ago • 0 comments

When making a top-level docstring, I usually just want to indicate what the functions in a particular file do. The generated placeholder docstring on the other hand contains all the possible exceptions that gets raised by the functions in the file. I am not sure if this is the official convention or not, and if so then a toggle to simply add a [summary] would be great. If on the other hand this is not the intended behavior then It's to be considered a bug.

Example of actual behavior (top-level indent issue already referenced in #152 )

    """
    [summary]

    Raises:
        ValidationError: [description]
    """

import json
from typing import Dict, Any
import flask
from my_package.api_errors import ValidationError

def validate_api_test() -> Dict[str, Any]:
    test = flask.request.form.get("test")
    if test is None:
        raise ValidationError("test field not provided")

Expected behavior

"""
[summary]
"""

import json
from typing import Dict, Any
import flask
from my_package.api_errors import ValidationError

def validate_api_test() -> Dict[str, Any]:
    test = flask.request.form.get("test")
    if test is None:
        raise ValidationError("test field not provided")

HitLuca avatar Jul 24 '20 09:07 HitLuca