Automatically generate docstrings for your Python function
github.com
github.com
Taking a comment as an example, compare:
if is_even(x): # if x is even
and: except UnicodeError as err: # Can happen on malformed IDNA.
One is not usefull (but can be derived automatically), the other one IS usefull to understand the code, but *can't be derived automatically* (without a deep understanding of the used libraries behind the various calls in the try statement).With this tool, you can programmatically add a dumb docstring to everything to make the linter shut up about old code, and still have it complain about new code.
Of course, some sort of ratcheting in your build pipeline would be better.
Pretty much all doc gen tools can generate is SBO comments so they are rarely useful.
Often they are essentially wrong, e.g. a getter with the autogenerated comment "gets the X from Y" without checking the method code to see if actually, it has some horrible side effects that you would not expect to be there. The comment hides the truth about the method.
His example was: "i++ // add 1 to i"
The primary goal of documentation is to make code easier to understand, not to copy code or to puzzle the reader. If the documentation doesn't help, then it's useless, so it must be deleted, or it makes readability worse, so it must be deleted.
Seems less pragmatic and more of a random death hill choice
I'd be fine with points being removed or even perhaps a failed assignment - not being essentially outed from the program by failing the course. The student needs a chance to improve - otherwise the only thing they'll learn is resentment
This is just one of many ways that running tools like pylint in CI can make your code worse.
It would make maintaining, bug fixing, and auditing complex software systems so much easier. It'd be a true game changer.