Skip to content

Commit a3223ed

Browse files
committed
run pre_commit hooks (black)
1 parent 95c815d commit a3223ed

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tabulate/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,9 @@ def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
27762776
i = 1
27772777
# Only count printable characters, so strip_ansi first, index later.
27782778
stripped_chunk = _strip_ansi(chunk)
2779-
while i <= len(stripped_chunk) and self._len(stripped_chunk[:i]) <= space_left:
2779+
while (
2780+
i <= len(stripped_chunk) and self._len(stripped_chunk[:i]) <= space_left
2781+
):
27802782
i = i + 1
27812783
# Consider escape codes when breaking words up
27822784
total_escape_len = 0

test/test_regression.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,15 @@ def test_alignment_of_decimal_numbers_with_ansi_color():
259259
def test_alignment_of_decimal_numbers_with_commas():
260260
"Regression: alignment for decimal numbers with comma separators"
261261
table = [["c1r1", "14502.05"], ["c1r2", 105]]
262-
result = tabulate(table, tablefmt="grid", floatfmt=',.2f')
262+
result = tabulate(table, tablefmt="grid", floatfmt=",.2f")
263263
expected = "\n".join(
264-
['+------+-----------+', '| c1r1 | 14,502.05 |',
265-
'+------+-----------+', '| c1r2 | 105.00 |',
266-
'+------+-----------+']
264+
[
265+
"+------+-----------+",
266+
"| c1r1 | 14,502.05 |",
267+
"+------+-----------+",
268+
"| c1r2 | 105.00 |",
269+
"+------+-----------+",
270+
]
267271
)
268272
assert_equal(expected, result)
269273

0 commit comments

Comments
 (0)