Skip to content

feat: Add support for !ignore tag and !reference/!reference-all scalar shorthand (spec v0.2.8-1)#19

Merged
dsillman2000 merged 4 commits intomainfrom
feat/spec-0-2-8
Mar 16, 2026
Merged

feat: Add support for !ignore tag and !reference/!reference-all scalar shorthand (spec v0.2.8-1)#19
dsillman2000 merged 4 commits intomainfrom
feat/spec-0-2-8

Conversation

@dsillman2000
Copy link
Copy Markdown
Owner

@dsillman2000 dsillman2000 commented Mar 16, 2026

v0.2.8-1 Spec Compliance Update

This branch brings the library up to spec v0.2.8-1.

What changed

  • Added full support for the !ignore tag, including parsing, pruning, and correct behavior inside referenced files.
  • Ensured !ignore interacts correctly with !merge and !flatten, so ignored sequence items are dropped before merge/flatten evaluation.
  • Added scalar shorthand support for both !reference and !reference-all.
    Example: !reference "service.yaml" and !reference-all "configs/*.yaml".
  • Added a new unit test suite for !ignore and expanded reference tests to cover shorthand parsing/loading.
  • Updated the README with !ignore, shorthand syntax examples, and VS Code yaml.customTags guidance.

Why it matters

  • Hidden anchor sections such as .anchors: !ignore now work cleanly without leaking into resolved output.
  • !ignore can now be used safely inside composition pipelines built from !merge and !flatten.
  • The parser now matches the spec for both mapping and scalar forms of reference tags.
  • Spec compliance is restored for the latest upstream scenarios.

Verification

  • uv run pytest tests/ -> 72 passed
  • make spec-test -> 127 scenarios passed

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

Updates yaml-reference to match spec v0.2.8-0 by adding the new !ignore composition tag and allowing scalar shorthand for !reference / !reference-all.

Changes:

  • Add scalar shorthand parsing for !reference and !reference-all.
  • Introduce !ignore tag support, plus a pruning pass during full resolution.
  • Add unit tests for shorthand parsing/loading and new !ignore behavior; update README examples and VS Code tag config.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
yaml_reference/__init__.py Adds scalar shorthand parsing, introduces Ignore + prune_ignores(), and wires pruning into the load pipeline
tests/unit/test_reference.py Adds shorthand coverage for both parsing and full resolution
tests/unit/test_ignore.py New unit test suite covering !ignore behaviors and pruning
README.md Documents !ignore, shorthand syntax, and updates VS Code YAML customTags guidance

You can also share your feedback on Copilot code review. Take the survey.

dsillman2000 and others added 2 commits March 15, 2026 21:51
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dsillman2000 dsillman2000 requested a review from ryodine March 16, 2026 02:00
@dsillman2000 dsillman2000 changed the title feat: Add support for !ignore tag and !reference/!reference-all scalar shorthand (spec v0.2.8-0) feat: Add support for !ignore tag and !reference/!reference-all scalar shorthand (spec v0.2.8-1) Mar 16, 2026
Copy link
Copy Markdown
Collaborator

@ryodine ryodine left a comment

Choose a reason for hiding this comment

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

awesome!

@dsillman2000 dsillman2000 merged commit f6b041a into main Mar 16, 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.

3 participants