Main entry point.
()
| 368 | |
| 369 | |
| 370 | def main(): |
| 371 | """Main entry point.""" |
| 372 | files_with_types = get_files_to_check() |
| 373 | |
| 374 | modified_files = [] |
| 375 | |
| 376 | for filepath, file_type in files_with_types: |
| 377 | if not os.path.exists(filepath): |
| 378 | # File might not exist (generated files, etc.) |
| 379 | continue |
| 380 | |
| 381 | if fix_file_includes(filepath, file_type): |
| 382 | modified_files.append(filepath) |
| 383 | |
| 384 | # Exit with appropriate code |
| 385 | if modified_files: |
| 386 | # Files were modified - exit 1 so pre-commit shows the diff |
| 387 | sys.exit(1) |
| 388 | else: |
| 389 | # No changes needed |
| 390 | sys.exit(0) |
| 391 | |
| 392 | |
| 393 | if __name__ == "__main__": |
no test coverage detected