|
14 | 14 | import os |
15 | 15 | import re |
16 | 16 | import sys |
17 | | -from typing import Generator, List, Tuple |
| 17 | +from typing import Iterable, List, Tuple |
18 | 18 |
|
19 | 19 | CAPITALIZATION_EXCEPTIONS = { |
20 | 20 | "pandas", |
@@ -148,7 +148,7 @@ def correct_title_capitalization(title: str) -> str: |
148 | 148 | return correct_title |
149 | 149 |
|
150 | 150 |
|
151 | | -def find_titles(rst_file: str) -> Generator[Tuple[str, int], None, None]: |
| 151 | +def find_titles(rst_file: str) -> Iterable[Tuple[str, int]]: |
152 | 152 | """ |
153 | 153 | Algorithm to identify particular text that should be considered headings in an |
154 | 154 | RST file. |
@@ -184,7 +184,7 @@ def find_titles(rst_file: str) -> Generator[Tuple[str, int], None, None]: |
184 | 184 | previous_line = line |
185 | 185 |
|
186 | 186 |
|
187 | | -def find_rst_files(source_paths: List[str]) -> Generator[str, None, None]: |
| 187 | +def find_rst_files(source_paths: List[str]) -> Iterable[str]: |
188 | 188 | """ |
189 | 189 | Given the command line arguments of directory paths, this method |
190 | 190 | yields the strings of the .rst file directories that these paths contain. |
@@ -214,7 +214,7 @@ def find_rst_files(source_paths: List[str]) -> Generator[str, None, None]: |
214 | 214 | yield filename |
215 | 215 |
|
216 | 216 |
|
217 | | -def main(source_paths: List[str], output_format: str) -> bool: |
| 217 | +def main(source_paths: List[str], output_format: str) -> int: |
218 | 218 | """ |
219 | 219 | The main method to print all headings with incorrect capitalization. |
220 | 220 |
|
|
0 commit comments