Skip to content

Add validation module - #15

Merged
DavidMStraub merged 2 commits into
mainfrom
validate
Aug 17, 2026
Merged

Add validation module#15
DavidMStraub merged 2 commits into
mainfrom
validate

Conversation

@DavidMStraub

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a first-pass dataset validation facility to gedcom7, exposing a validate() API and integrating optional pre-serialization validation into dumps().

Changes:

  • Introduces gedcom7.validate with an Error model and a validate(records) function to report multiple dataset issues in one pass.
  • Adds GedcomValidationError and wires serializer.dumps(..., validate=True) to raise it with all discovered problems.
  • Adds comprehensive tests covering dataset shape, pointers, payload kinds/values (incl. date sanity checks), schema declarations, and dumps validation behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/test_validate.py Adds unit tests for the new validation behavior and dumps(validate=True) integration.
gedcom7/validate.py Implements dataset validation (document shape, schema conflicts, payload checks, pointer checks, and date range sanity checks).
gedcom7/serializer.py Adds validate option to dumps() and raises GedcomValidationError when validation fails.
gedcom7/exceptions.py Introduces GedcomValidationError carrying all validation issues and summarizing them in the exception message.
gedcom7/init.py Exports validate, Error, and GedcomValidationError as part of the public API.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread gedcom7/validator.py
@DavidMStraub
DavidMStraub merged commit 16bbc22 into main Aug 17, 2026
6 checks passed
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.

2 participants