Invalidate the cache when lint/test fails, forcing a re-run next time.
()
| 77 | |
| 78 | |
| 79 | def invalidate_cache() -> None: |
| 80 | """Invalidate the cache when lint/test fails, forcing a re-run next time.""" |
| 81 | cache = _get_js_lint_cache() |
| 82 | |
| 83 | try: |
| 84 | cache.invalidate() |
| 85 | print_cache_miss( |
| 86 | "Lint cache invalidated due to failure - will re-run next time" |
| 87 | ) |
| 88 | except KeyboardInterrupt: |
| 89 | _thread.interrupt_main() |
| 90 | raise |
| 91 | except Exception as e: |
| 92 | print_cache_miss(f"Failed to invalidate cache: {e}") |
| 93 | |
| 94 | |
| 95 | def main() -> int: |
no test coverage detected