MCPcopy
hub / github.com/psf/black / contains_implicit_multiline_string_with_comments

Method contains_implicit_multiline_string_with_comments

src/black/lines.py:249–262  ·  view source on GitHub ↗

Check if we have an implicit multiline string with comments on the line

(self)

Source from the content-addressed store, hash-verified

247 return False
248
249 def contains_implicit_multiline_string_with_comments(self) -> bool:
250 """Check if we have an implicit multiline string with comments on the line"""
251 for leaf_type, leaf_group_iterator in itertools.groupby(
252 self.leaves, lambda leaf: leaf.type
253 ):
254 if leaf_type != token.STRING:
255 continue
256 leaf_list = list(leaf_group_iterator)
257 if len(leaf_list) == 1:
258 continue
259 for leaf in leaf_list:
260 if self.comments_after(leaf):
261 return True
262 return False
263
264 def contains_uncollapsable_type_comments(self) -> bool:
265 ignored_ids = set()

Callers 1

transform_lineFunction · 0.80

Calls 1

comments_afterMethod · 0.95

Tested by

no test coverage detected