Skip to content

Commit

Permalink
Apply code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Feb 11, 2024
1 parent 63bfee6 commit 15338ae
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 15 deletions.
28 changes: 24 additions & 4 deletions examples/py/multi_byte_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,31 @@ def main() -> None:
table_name="生成に関するパターン",
headers=["パターン名", "概要", "GoF", "Code Complete[1]"],
value_matrix=[
["Abstract Factory", "関連する一連のインスタンスを状況に応じて、適切に生成する方法を提供する。", "Yes", "Yes"],
[
"Abstract Factory",
"関連する一連のインスタンスを状況に応じて、適切に生成する方法を提供する。",
"Yes",
"Yes",
],
["Builder", "複合化されたインスタンスの生成過程を隠蔽する。", "Yes", "No"],
["Factory Method", "実際に生成されるインスタンスに依存しない、インスタンスの生成方法を提供する。", "Yes", "Yes"],
["Prototype", "同様のインスタンスを生成するために、原型のインスタンスを複製する。", "Yes", "No"],
["Singleton", "あるクラスについて、インスタンスが単一であることを保証する。", "Yes", "Yes"],
[
"Factory Method",
"実際に生成されるインスタンスに依存しない、インスタンスの生成方法を提供する。",
"Yes",
"Yes",
],
[
"Prototype",
"同様のインスタンスを生成するために、原型のインスタンスを複製する。",
"Yes",
"No",
],
[
"Singleton",
"あるクラスについて、インスタンスが単一であることを保証する。",
"Yes",
"Yes",
],
],
theme="altrow",
)
Expand Down
9 changes: 3 additions & 6 deletions pytablewriter/style/_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@


class StyleFilterFunc(Protocol):
def __call__(self, cell: Cell, **kwargs: Any) -> Optional[Style]:
...
def __call__(self, cell: Cell, **kwargs: Any) -> Optional[Style]: ...


class ColSeparatorStyleFilterFunc(Protocol):
def __call__(
self, left_cell: Optional[Cell], right_cell: Optional[Cell], **kwargs: Any
) -> Optional[Style]:
...
) -> Optional[Style]: ...


class CheckStyleFilterKeywordArgsFunc(Protocol):
def __call__(self, **kwargs: Any) -> None:
...
def __call__(self, **kwargs: Any) -> None: ...


class Theme(NamedTuple):
Expand Down
8 changes: 7 additions & 1 deletion test/sanitizer/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ def test_normal(self, value, replace_text, expected):
assert sanitized_name == expected
validate_excel_sheet_name(sanitized_name)

@pytest.mark.parametrize(["value", "expected"], [["あい*うえお", "あいうえお"], ["シー?ト", "シート"]])
@pytest.mark.parametrize(
["value", "expected"],
[
["あい*うえお", "あいうえお"],
["シー?ト", "シート"],
],
)
def test_normal_multibyte(self, value, expected):
sanitize_excel_sheet_name(value)

Expand Down
28 changes: 24 additions & 4 deletions test/writer/text/test_multibyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,31 @@ def test_smoke_multi_byte(self, format_name):
table_name="生成に関するパターン",
headers=["パターン名", "概要", "GoF", "Code Complete[1]"],
value_matrix=[
["Abstract Factory", "関連する一連のインスタンスを状況に応じて、適切に生成する方法を提供する。", "Yes", "Yes"],
[
"Abstract Factory",
"関連する一連のインスタンスを状況に応じて、適切に生成する方法を提供する。",
"Yes",
"Yes",
],
["Builder", "複合化されたインスタンスの生成過程を隠蔽する。", "Yes", "No"],
["Factory Method", "実際に生成されるインスタンスに依存しない、インスタンスの生成方法を提供する。", "Yes", "Yes"],
["Prototype", "同様のインスタンスを生成するために、原型のインスタンスを複製する。", "Yes", "No"],
["Singleton", "あるクラスについて、インスタンスが単一であることを保証する。", "Yes", "Yes"],
[
"Factory Method",
"実際に生成されるインスタンスに依存しない、インスタンスの生成方法を提供する。",
"Yes",
"Yes",
],
[
"Prototype",
"同様のインスタンスを生成するために、原型のインスタンスを複製する。",
"Yes",
"No",
],
[
"Singleton",
"あるクラスについて、インスタンスが単一であることを保証する。",
"Yes",
"Yes",
],
],
)

Expand Down

0 comments on commit 15338ae

Please sign in to comment.