Skip to content

Commit 3a3e8a1

Browse files
committed
Changing separator between single and multiline comments to space
1 parent 6c5a3db commit 3a3e8a1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tap/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def get_class_variables(cls: type) -> OrderedDict:
213213
if (class_variable is not None
214214
and token['token_type'] == tokenize.STRING
215215
and token['token'][:3] in {'"""', "'''"}):
216-
sep = '\n\n' if variable_to_comment[class_variable]['comment'] else ''
216+
sep = ' ' if variable_to_comment[class_variable]['comment'] else ''
217217
variable_to_comment[class_variable]['comment'] += sep + token['token'][3:-3].strip()
218218

219219
# Match class variable

tests/test_utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def func(self):
215215
class_variables = OrderedDict()
216216
class_variables['arg_1'] = {'comment': 'Arg 1 comment'}
217217
class_variables['arg_2'] = {'comment': 'Arg 2 comment'}
218-
class_variables['arg_3'] = {'comment': 'Poorly formatted comment\n\nMore comment'}
218+
class_variables['arg_3'] = {'comment': 'Poorly formatted comment More comment'}
219219
self.assertEqual(get_class_variables(CommentedVariable), class_variables)
220220

221221
def test_bad_spacing_multiline(self):
@@ -237,7 +237,7 @@ class TrickyMultiline:
237237
"""
238238

239239
class_variables = OrderedDict()
240-
comment = 'Header line\n\nFooter\nT\n A\n P\n\n multi\n line!!'
240+
comment = 'Header line Footer\nT\n A\n P\n\n multi\n line!!'
241241
class_variables['foo'] = {'comment': comment}
242242
self.assertEqual(get_class_variables(TrickyMultiline), class_variables)
243243

@@ -254,9 +254,9 @@ def test_functions_with_docs_multiline(self):
254254
class FunctionsWithDocs:
255255
i: int = 0
256256

257-
def f():
257+
def f(self):
258258
"""Function"""
259-
a: str = 0
259+
a: str = 'hello'
260260
"""with docs"""
261261

262262
class_variables = OrderedDict()

0 commit comments

Comments
 (0)