Skip to content

Commit 08e59cf

Browse files
committed
refactor: Add missing type annotations
1 parent 404e640 commit 08e59cf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: docs/source/generate_style_list.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from table2ascii import PresetStyle, table2ascii
55

66

7-
def indent_all_lines(text, number_of_spaces=3):
7+
def indent_all_lines(text: str, number_of_spaces: int = 3) -> str:
88
"""Indent all lines in a string by a certain number of spaces"""
99
return "\n".join(number_of_spaces * " " + line for line in text.split("\n"))
1010

1111

12-
def generate_style_list():
12+
def generate_style_list() -> str:
1313
"""Generate README.rst the style list"""
1414
# get attributes in PresetStyle
1515
attribute_names = [attr for attr in dir(PresetStyle) if not attr.startswith("__")]
@@ -43,7 +43,7 @@ def generate_style_list():
4343
return f"{heading}\n\n{table_of_contents}\n{style_list}"
4444

4545

46-
def write_to_file(filename, content):
46+
def write_to_file(filename: str, content: str) -> None:
4747
"""Write content to filename"""
4848
with open(filename, "w") as f:
4949
f.write(content)

Diff for: table2ascii/merge.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ class Merge(Enum):
3939

4040
LEFT = 0
4141

42-
def __str__(self):
42+
def __str__(self) -> str:
4343
return ""

Diff for: table2ascii/table_style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def from_string(cls, string: str) -> "TableStyle":
132132
string += " " * (num_params - len(string))
133133
return cls(*string)
134134

135-
def set(self, **kwargs) -> "TableStyle":
135+
def set(self, **kwargs: str) -> "TableStyle":
136136
"""Set attributes of the TableStyle
137137
138138
Args:

0 commit comments

Comments
 (0)