-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Optional feature: return statement at the end of a function #237
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
Comments
Original comment by BitBucket: SylvainDe, GitHub: @SylvainDe?: Maybe I got it wrong but it might be even more interesting (as in less false negative) to have a warning if the functions doesn't return a value (either by the lack of "return" at the end or by a "return" with no value associated) in functions where we return an actual value in at least one place. For instance :
|
Original comment by BitBucket: SylvainDe, GitHub: @SylvainDe?: As a side-note, PEP 8 has been updated to reflect this kind of change : https://mail.python.org/pipermail/python-dev/2015-April/139054.html . |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): It would be nice to have this as well. If you want to work on a patch, that would be lovely. ;-) Otherwise I'll get to this issue at some point in the future. |
Original comment by BitBucket: SylvainDe, GitHub: @SylvainDe?: I've submitted a pull-request related to this on pep8 : https://github.com/PyCQA/pep8/pulls (I'm quite proud of the way it works but the pep8 community does not seem to be ecstatic about it). I'll try implement something similar in for pylint in the next couple of months. I'll probably need some help : I've jointed the IRC channel and might ask on the mailing-list if I get stuck for too long. Cheers. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): That's great, don't hesitate to ask any question you might have. |
Closing in favor of #1267 |
Originally reported by: Anonymous
It would be nice to have a checker checking whether all functions end with a return-statement. The trivial statement
'return '
should be allowed, too. This feature should be optional and by default be turned off in the config file, e.g.
'min-returns=0'.
The text was updated successfully, but these errors were encountered: