Main entry point for C++ lint cache checking.
()
| 120 | |
| 121 | |
| 122 | def main() -> int: |
| 123 | """Main entry point for C++ lint cache checking.""" |
| 124 | if len(sys.argv) < 2: |
| 125 | print("Usage: python ci/cpp_lint_cache.py [check|success|failure]") |
| 126 | return 1 |
| 127 | |
| 128 | command = sys.argv[1] |
| 129 | |
| 130 | if command == "check": |
| 131 | # Check if linting is needed |
| 132 | needs_lint = check_cpp_files_changed() |
| 133 | return 0 if needs_lint else 1 # Exit 1 means skip linting |
| 134 | |
| 135 | elif command == "success": |
| 136 | # Mark lint as successful |
| 137 | mark_cpp_lint_success() |
| 138 | return 0 |
| 139 | |
| 140 | elif command == "failure": |
| 141 | # Invalidate cache on failure |
| 142 | invalidate_cpp_cache() |
| 143 | return 0 |
| 144 | |
| 145 | else: |
| 146 | print(f"Unknown command: {command}") |
| 147 | return 1 |
| 148 | |
| 149 | |
| 150 | if __name__ == "__main__": |
no test coverage detected