Permalink
Browse files

DocumentationExtraction.py: Diff cut-off fix

Fix diff's cut-off bug.
Added subequent test cases.
Fixes #4187
  • Loading branch information...
damngamerz committed May 26, 2017
1 parent e05c816 commit e41d6b59b78f929b484c0521ca4618901bcaba9e
@@ -36,7 +36,10 @@ def _extract_doc_comment_simple(content, line, column, markers):
while line < len(content):
pos = content[line].find(markers[2])
if pos == -1:
line_column = len(content[line])-len(content[line].lstrip())
doc_comment += ('\n' if content[line][align_column:] == ''
else content[line].strip()+'\n'
if line_column < align_column
else content[line][align_column:])
else:
doc_comment += content[line][align_column:pos]
@@ -180,7 +180,16 @@ def test_extract_documentation_PYTHON3(self):
'short'),
docstyle_PYTHON3_default, '',
docstyle_PYTHON3_default.markers[0],
TextRange.from_values(40, 1, 42, 9)))
TextRange.from_values(40, 1, 42, 9)),
DocumentationComment(
('\n'
'A bad indented docstring\n'
' Improper indentation.\n'
':param impact: The force of Impact.\n'),
docstyle_PYTHON3_default, ' ' * 4,
docstyle_PYTHON3_default.markers[0],
TextRange.from_values(45, 5, 49, 8)),
)
self.assertEqual(
tuple(extract_documentation(data, 'PYTHON3', 'default')),
@@ -40,3 +40,10 @@ def foobar_travel(country):
"""super
nicely
short"""
def foobar_collision(impact):
"""
A bad indented docstring
Improper indentation.
:param impact: The force of Impact.
"""

0 comments on commit e41d6b5

Please sign in to comment.