Skip to content

Validate IfVersion page declarations - #1324

Draft
danielporterda wants to merge 1 commit into
snippet-syntax-error-diagnosticsfrom
snippet-validate-condition-page
Draft

Validate IfVersion page declarations#1324
danielporterda wants to merge 1 commit into
snippet-syntax-error-diagnosticsfrom
snippet-validate-condition-page

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Composes conditional-page validation only: parses <IfVersion>/<Else>, reports classified syntax errors, validates structure, validates each opening condition's attributes, and returns typed valid conditions plus diagnostics.

It intentionally does not parse or validate any <Snippet> declaration.

Why

Conditional page composition is independently reviewable from snippet composition and from the eventual whole-page CLI.

Validation

  • python -m pytest tests/test_condition_page_validation.py tests/test_if_version_attribute_diagnostics.py tests/test_if_version_structure_diagnostics.py tests/test_directive_syntax_diagnostics.py (20 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/page_validation.py tests/test_condition_page_validation.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/page_validation.py
  • git diff --check

Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant