pyment icon indicating copy to clipboard operation
pyment copied to clipboard

Fix broken output when class docstring is missing

Open acarapetis opened this issue 4 years ago • 0 comments

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.

acarapetis avatar Aug 23 '21 08:08 acarapetis