Classes
ValidationCacheMixin
Mixin providing validation result caching.
Requires these attributes on the host class:
- vali…
ValidationCacheMixin
Mixin providing validation result caching.
Requires these attributes on the host class:
- validation_results: dict[str, dict[str, list[dict[str, Any]]]]
- is_changed: Callable[[Path], bool] (from FileTrackingMixin)
Attributes
| Name | Type | Description |
|---|---|---|
validation_results |
dict[str, dict[str, list[dict[str, Any]]]] |
Methods 4
is_changed
Check if file changed (provided by FileTrackingMixin).
is_changed
def is_changed(self, file_path: Path) -> bool
Check if file changed (provided by FileTrackingMixin).
Parameters 1
file_path |
Path |
Returns
bool
get_cached_validation_results
Get cached validation results for a file and validator.
get_cached_validation_results
def get_cached_validation_results(self, file_path: Path, validator_name: str) -> list[dict[str, Any]] | None
Get cached validation results for a file and validator.
Parameters 2
file_path |
Path |
Path to file |
validator_name |
str |
Name of validator |
Returns
List of CheckResult dicts if cached and file unchanged, None otherwiselist[dict[str, Any]] | None
—
cache_validation_results
Cache validation results for a file and validator.
cache_validation_results
def cache_validation_results(self, file_path: Path, validator_name: str, results: list[Any]) -> None
Cache validation results for a file and validator.
Parameters 3
file_path |
Path |
Path to file |
validator_name |
str |
Name of validator |
results |
list[Any] |
List of CheckResult objects to cache |
invalidate_validation_results
Invalidate validation results for a file or all files.
invalidate_validation_results
def invalidate_validation_results(self, file_path: Path | None = None) -> None
Invalidate validation results for a file or all files.
Parameters 1
file_path |
Path | None |
Path to file (if None, invalidate all) |