()
| 10 | |
| 11 | |
| 12 | def main() -> int: |
| 13 | lines = EPUBCHECK_PATH.read_text(encoding='utf-8').splitlines() |
| 14 | fatal_errors = [line for line in lines if line.startswith('FATAL')] |
| 15 | |
| 16 | if fatal_errors: |
| 17 | err_count = len(fatal_errors) |
| 18 | s = 's' * (err_count != 1) |
| 19 | print() |
| 20 | print(f'Error: epubcheck reported {err_count} fatal error{s}:') |
| 21 | print() |
| 22 | print('\n'.join(fatal_errors)) |
| 23 | return 1 |
| 24 | |
| 25 | print('Success: no fatal errors found.') |
| 26 | return 0 |
| 27 | |
| 28 | |
| 29 | if __name__ == '__main__': |
no test coverage detected
searching dependent graphs…