MCPcopy
hub / github.com/pandas-dev/pandas / main

Function main

scripts/validate_rst_title_capitalization.py:251–278  ·  view source on GitHub ↗

The main method to print all headings with incorrect capitalization. Parameters ---------- source_paths : str List of directories to validate, provided through command line arguments. Returns ------- int Number of incorrect headings found overall.

(source_paths: list[str])

Source from the content-addressed store, hash-verified

249
250
251def main(source_paths: list[str]) -> int:
252 """
253 The main method to print all headings with incorrect capitalization.
254
255 Parameters
256 ----------
257 source_paths : str
258 List of directories to validate, provided through command line arguments.
259
260 Returns
261 -------
262 int
263 Number of incorrect headings found overall.
264 """
265
266 number_of_errors: int = 0
267
268 for filename in source_paths:
269 for title, line_number in find_titles(filename):
270 if title != correct_title_capitalization(title):
271 print(
272 f"""{filename}:{line_number}:{err_msg} "{title}" to "{
273 correct_title_capitalization(title)
274 }" """
275 )
276 number_of_errors += 1
277
278 return number_of_errors
279
280
281if __name__ == "__main__":

Calls 2

find_titlesFunction · 0.85

Tested by

no test coverage detected