smurfix/flask-script

Parse standard python documentation comment

sils opened this issue · 1 comments

sils commented

I would love to be able to define a command as:

@manager.command
def coala(noninteractive=False):
    """
    Runs code analysis on the application.

    :param noninteractive: True if no interactions are to be done. (JSON
    output will be generated in this case.)
    :return: 0 if all is well.
    """
    if noninteractive:
        exit(call(['coala-format', '-S', 'format_str={origin}, {file}, from '
                                         '{line} to {end_line}. {message}']))
    else:
        exit(call('coala'))

And then automatically get the parameter noninteractive documented. Also only the main description should be shown in the help of the coala command. You could steal a bit from our project, we already wrote a documentation parser: https://github.com/coala-analyzer/coala/blob/master/coalib/settings/DocumentationComment.py#L7 (tests in https://github.com/coala-analyzer/coala/blob/master/coalib/tests/settings/DocumentationCommentTest.py if you care).

This is a neat idea; however, I'm closing this because it is unlikely to get implemented anytime in the near future (unless you put together a PR). I'm also concerned about the maintenance--we're already lacking maintainer time and adding this would create a lot of edge cases around this behavior that I have no interest in supporting.