by julienpalard · 4y ago · 0 comments
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).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.
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.
His example was: "i++ // add 1 to i"
Seems less pragmatic and more of a random death hill choice
This is just one of many ways that running tools like pylint in CI can make your code worse.