()
| 247 | |
| 248 | |
| 249 | def main(): |
| 250 | args = cli() |
| 251 | files = args.files |
| 252 | diagnostics: list[tuple[Path, list[Diagnostic]]] = [] |
| 253 | for file in expand_glob(files): |
| 254 | with open(file, 'r') as f: |
| 255 | file_diagnostics = check_code_block_format(f) |
| 256 | for diagnostic in file_diagnostics: |
| 257 | diagnostics.append((file, file_diagnostics)) |
| 258 | if diagnostics: |
| 259 | for file, file_diagnostics in diagnostics: |
| 260 | for diagnostic in file_diagnostics: |
| 261 | show_diagnostic(file, diagnostic) |
| 262 | sys.exit(1) |
| 263 | |
| 264 | |
| 265 | if __name__ == "__main__": |
no test coverage detected