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