We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 112a80b commit 948c28aCopy full SHA for 948c28a
src/docformatter/format.py
@@ -260,11 +260,22 @@ def _get_class_docstring_newlines(
260
The number of newlines to insert after the docstring.
261
"""
262
j = index + 1
263
+ indention_level = tokens[index].start[1]
264
265
# The docstring is followed by a comment.
266
if tokens[j].string.startswith("#"):
267
return 0
268
269
+ while j < len(tokens):
270
+ if tokens[j].type in (tokenize.NL, tokenize.NEWLINE):
271
+ j += 1
272
+ continue
273
+
274
+ if tokens[j].start[1] < indention_level:
275
+ return 2
276
277
+ break
278
279
return 1
280
281
0 commit comments