Add `Returns: None` when no explicit return statement is found
Hi, just another small feedback on your great plugin.
I haven't found any official guideline for what to put in a docstring when no explicit return statement is found, but this stackoverflow question suggests it should be like this:
"""Prints the element given as input
Args:
x: any element
Returns:
None
"""
Do you think this is something you could/would like to implement?
Thank you for the feedback.
According to PEP 257, "The docstring for a function or method should summarize its behavior and document its arguments, return value(s), side effects, exceptions raised, and restrictions on when it can be called (all if applicable)".
Therefore, strictly speaking, I do not think it should be there,
If a function does not contain return expression it always returns None, so why write it down.
However, I am open to adding this (optional) functionality (PRs are welcome :-)). I might implement it myself, but I can't promise when.
You're right, it's debatable.
About your PEP 257 quote, one could argue that since a function always has a return value, then it's always applicable to document its return value (including None).
I'll have a look into the actual code of your plugin, not a vim code expert, but maybe it's easy ;)