Main entry point for Python lint cache checking.
()
| 97 | |
| 98 | |
| 99 | def main() -> int: |
| 100 | """Main entry point for Python lint cache checking.""" |
| 101 | if len(sys.argv) < 2: |
| 102 | print("Usage: python ci/python_lint_cache.py [check|success|failure]") |
| 103 | return 1 |
| 104 | |
| 105 | command = sys.argv[1] |
| 106 | |
| 107 | if command == "check": |
| 108 | # Check if pyright is needed |
| 109 | needs_lint = check_python_files_changed() |
| 110 | return 0 if needs_lint else 1 # Exit 1 means skip pyright |
| 111 | |
| 112 | elif command == "success": |
| 113 | # Mark lint as successful |
| 114 | mark_python_lint_success() |
| 115 | return 0 |
| 116 | |
| 117 | elif command == "failure": |
| 118 | # Invalidate cache on failure |
| 119 | invalidate_python_cache() |
| 120 | return 0 |
| 121 | |
| 122 | else: |
| 123 | print(f"Unknown command: {command}") |
| 124 | return 1 |
| 125 | |
| 126 | |
| 127 | if __name__ == "__main__": |
no test coverage detected