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

Function _safe_add_trailing_comma

src/black/linegen.py:1350–1359  ·  view source on GitHub ↗
(safe: bool, delimiter_priority: int, line: Line)

Source from the content-addressed store, hash-verified

1348
1349
1350def _safe_add_trailing_comma(safe: bool, delimiter_priority: int, line: Line) -> Line:
1351 if (
1352 safe
1353 and delimiter_priority == COMMA_PRIORITY
1354 and line.leaves[-1].type != token.COMMA
1355 and line.leaves[-1].type != STANDALONE_COMMENT
1356 ):
1357 new_comma = Leaf(token.COMMA, ",")
1358 line.append(new_comma)
1359 return line
1360
1361
1362MIGRATE_COMMENT_DELIMITERS = {STRING_PRIORITY, COMMA_PRIORITY}

Callers 1

delimiter_splitFunction · 0.85

Calls 2

LeafClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected