pyment
pyment copied to clipboard
Fix broken output when class docstring is missing
Fixes #83.
pyment was generating output with invalid indentation when all of the following conditions were met:
- ignore_private is
True(the default on the command line) - a class has no docstring
- the first method in that class is "private" (i.e.
__dunder__) and has a docstring.
When skipping the private method header, the parser still had the waiting_docs flag set, and thus it was mistaking the method docstring for the class docstring.