Skip to content

Commit 265b842

Browse files
authored
TYP: Fixed type annotaions in scripts/validate_rst_title_capitalization (#33268)
1 parent 3532e3e commit 265b842

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/validate_rst_title_capitalization.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import os
1515
import re
1616
import sys
17-
from typing import Generator, List, Tuple
17+
from typing import Iterable, List, Tuple
1818

1919
CAPITALIZATION_EXCEPTIONS = {
2020
"pandas",
@@ -148,7 +148,7 @@ def correct_title_capitalization(title: str) -> str:
148148
return correct_title
149149

150150

151-
def find_titles(rst_file: str) -> Generator[Tuple[str, int], None, None]:
151+
def find_titles(rst_file: str) -> Iterable[Tuple[str, int]]:
152152
"""
153153
Algorithm to identify particular text that should be considered headings in an
154154
RST file.
@@ -184,7 +184,7 @@ def find_titles(rst_file: str) -> Generator[Tuple[str, int], None, None]:
184184
previous_line = line
185185

186186

187-
def find_rst_files(source_paths: List[str]) -> Generator[str, None, None]:
187+
def find_rst_files(source_paths: List[str]) -> Iterable[str]:
188188
"""
189189
Given the command line arguments of directory paths, this method
190190
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]:
214214
yield filename
215215

216216

217-
def main(source_paths: List[str], output_format: str) -> bool:
217+
def main(source_paths: List[str], output_format: str) -> int:
218218
"""
219219
The main method to print all headings with incorrect capitalization.
220220

0 commit comments

Comments
 (0)