Major fixes and new features
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-25 15:51:48 +09:00
parent dd7349bb4c
commit ddce9f5125
5586 changed files with 1470941 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
from __future__ import annotations
from contextlib import contextmanager
from typing import Final, Iterator
# These are global mutable state. Don't add anything here unless there's a very
# good reason.
class StrictOptionalState:
# Wrap this in a class since it's faster that using a module-level attribute.
def __init__(self, strict_optional: bool) -> None:
# Value varies by file being processed
self.strict_optional = strict_optional
@contextmanager
def strict_optional_set(self, value: bool) -> Iterator[None]:
saved = self.strict_optional
self.strict_optional = value
try:
yield
finally:
self.strict_optional = saved
state: Final = StrictOptionalState(strict_optional=False)
find_occurrences: tuple[str, str] | None = None