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])
| 249 | |
| 250 | |
| 251 | def 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 | |
| 281 | if __name__ == "__main__": |
no test coverage detected