Skip to content

Feature/ensure in list#38

Merged
nathanjmcdougall merged 11 commits into
mainfrom
feature/ensure-in-list
May 21, 2026
Merged

Feature/ensure in list#38
nathanjmcdougall merged 11 commits into
mainfrom
feature/ensure-in-list

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an idempotent “ensure present” list operation to yamltrip’s Document API (immutable) and Editor API (mutable), enabling users to append items only when missing, with optional dict-item matching via a where filter.

Changes:

  • Implement Document.ensure_in_list(..., value, where=None) with no-op-if-present semantics and path-missing list creation.
  • Add Editor.ensure_in_list(...) as a thin delegating wrapper.
  • Add README examples plus new unit tests covering scalar, where matching, path creation, flow sequences, and error cases.

Reviewed changes

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

Show a summary per file
File Description
tests/test_editor.py Adds editor-level tests for ensure_in_list behavior and delegation.
tests/test_document.py Adds document-level coverage for ensure_in_list semantics and edge cases.
src/yamltrip/editor.py Exposes ensure_in_list on Editor by delegating to Document.
src/yamltrip/document.py Implements ensure_in_list using existing query/upsert/append primitives.
README.md Documents the new API with scalar and where examples.
doc/specs/2026-05-22-ensure-in-list-design.md Adds a design/spec document for the new operation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_editor.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread src/yamltrip/document.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@nathanjmcdougall nathanjmcdougall merged commit e8498bb into main May 21, 2026
19 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