Skip to content

Remove validate_file() and LiftValidationError - #49

Open
imnasnainaec wants to merge 1 commit into
mainfrom
remove-validate-file
Open

imnasnainaec wants to merge 1 commit into
mainfrom
remove-validate-file

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes validate_file() and LiftValidationError from the public API (R1 of the #30 API surface review).

 sil_lift.__all__
   iter_problems(path, *, require_ids=False)
   Lexicon.iter_problems(*, require_ids=False)
   Problem
   LiftError
     LiftParseError
     LiftWriteError
-    LiftValidationError
-  validate_file(path)

validate_file() was iter_problems() that raised on the first error. It was the only thing that raised LiftValidationError, and it took no require_ids, so it couldn't back the re-import gate. The validate guide now shows the fail-fast check written against iter_problems() instead:

if any(p.level == "error" for p in sil_lift.iter_problems("dictionary.lift")):
    raise SystemExit(1)

The CHANGELOG's 0.1.0 Validation entry no longer lists validate_file(). 0.1.0 is unreleased, so this needs no "Removed" entry.

Evidence

  • Before: test_validate_file_raises_on_first_error and test_validate_file_passes_on_warning_only_files exercised the wrapper.
    After: both removed. ruff check, ruff format --check, mypy --strict, pytest (688 passed, 5 skipped), and mkdocs build --strict all pass.

Merge Danger

Door: two-way

Nothing has been published yet, so restoring the function means reverting this commit. After 1.0, adding it back would be additive (minor) and removing it again would be major.

Blast Radius: none

No src/ caller, CLI path, or Action input used either name.

Refs #30

🤖 Generated with Claude Code


This change is Reviewable

validate_file() was iter_problems() raising on the first error-level
problem, and the only thing that raised LiftValidationError. It took no
require_ids, so it could not serve the re-import gate where fail-fast
matters most, and the fail-fast check is a one-line any() over
iter_problems(), which the validate guide now shows. CLI pipelines
already get it from the exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@imnasnainaec imnasnainaec added the 🟨Medium Medium-priority PR label Oct 8, 2026
@imnasnainaec imnasnainaec self-assigned this Oct 8, 2026
@imnasnainaec
imnasnainaec marked this pull request as ready for review October 8, 2026 21:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🟨Medium Medium-priority PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant