Invalidate the cache when lint/test fails, forcing a re-run next time.
()
| 81 | |
| 82 | |
| 83 | def invalidate_python_cache() -> None: |
| 84 | """Invalidate the cache when lint/test fails, forcing a re-run next time.""" |
| 85 | cache = _get_python_lint_cache() |
| 86 | |
| 87 | try: |
| 88 | cache.invalidate() |
| 89 | print_cache_miss( |
| 90 | "Python lint cache invalidated - will re-run pyright next time" |
| 91 | ) |
| 92 | except KeyboardInterrupt as ki: |
| 93 | handle_keyboard_interrupt(ki) |
| 94 | raise |
| 95 | except Exception as e: |
| 96 | print_cache_miss(f"Failed to invalidate Python cache: {e}") |
| 97 | |
| 98 | |
| 99 | def main() -> int: |
no test coverage detected