Skip to content

Commit b96c59a

Browse files
committed
run pre-commit hooks (black)
1 parent 5c10c81 commit b96c59a

4 files changed

Lines changed: 23 additions & 14 deletions

File tree

tabulate/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,9 +1599,11 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"):
15991599
if headers == "keys":
16001600
headers = field_names
16011601
rows = [
1602-
[getattr(row, f) for f in field_names]
1603-
if not _is_separating_line(row)
1604-
else row
1602+
(
1603+
[getattr(row, f) for f in field_names]
1604+
if not _is_separating_line(row)
1605+
else row
1606+
)
16051607
for row in rows
16061608
]
16071609

@@ -1685,9 +1687,11 @@ def _wrap_text_to_colwidths(
16851687
casted_cell = (
16861688
missingval
16871689
if cell is None
1688-
else str(cell)
1689-
if cell == "" or _isnumber(cell)
1690-
else str(_type(cell, numparse)(cell))
1690+
else (
1691+
str(cell)
1692+
if cell == "" or _isnumber(cell)
1693+
else str(_type(cell, numparse)(cell))
1694+
)
16911695
)
16921696
wrapped = [
16931697
"\n".join(wrapper.wrap(line))

test/test_api.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""API properties.
2-
3-
"""
1+
"""API properties."""
42

53
from tabulate import tabulate, tabulate_formats, simple_separated_format
64
from common import skip

test/test_cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""Command-line interface.
2-
3-
"""
1+
"""Command-line interface."""
42

53
import os
64
import sys

test/test_internal.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ def test_wrap_text_wide_chars():
180180
except ImportError:
181181
skip("test_wrap_text_wide_chars is skipped")
182182

183-
rows = [["청자청자청자청자청자", "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다"]]
183+
rows = [
184+
["청자청자청자청자청자", "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다"]
185+
]
184186
widths = [5, 20]
185187
expected = [
186188
[
@@ -244,7 +246,14 @@ def test_wrap_text_to_colwidths_colors_wide_char():
244246
except ImportError:
245247
skip("test_wrap_text_to_colwidths_colors_wide_char is skipped")
246248

247-
data = [[("\033[31m약간 감싸면 더 잘 보일 수있는 다소 긴" " 설명입니다 설명입니다 설명입니다 설명입니다 설명\033[0m")]]
249+
data = [
250+
[
251+
(
252+
"\033[31m약간 감싸면 더 잘 보일 수있는 다소 긴"
253+
" 설명입니다 설명입니다 설명입니다 설명입니다 설명\033[0m"
254+
)
255+
]
256+
]
248257
result = T._wrap_text_to_colwidths(data, [30])
249258

250259
expected = [

0 commit comments

Comments
 (0)