feat: Add support for !ignore tag and !reference/!reference-all scalar shorthand (spec v0.2.8-1)#19
Merged
dsillman2000 merged 4 commits intomainfrom Mar 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
!referenceand!reference-all. - Introduce
!ignoretag support, plus a pruning pass during full resolution. - Add unit tests for shorthand parsing/loading and new
!ignorebehavior; 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.2.8-1 Spec Compliance Update
This branch brings the library up to spec
v0.2.8-1.What changed
!ignoretag, including parsing, pruning, and correct behavior inside referenced files.!ignoreinteracts correctly with!mergeand!flatten, so ignored sequence items are dropped before merge/flatten evaluation.!referenceand!reference-all.Example:
!reference "service.yaml"and!reference-all "configs/*.yaml".!ignoreand expanded reference tests to cover shorthand parsing/loading.!ignore, shorthand syntax examples, and VS Codeyaml.customTagsguidance.Why it matters
.anchors: !ignorenow work cleanly without leaking into resolved output.!ignorecan now be used safely inside composition pipelines built from!mergeand!flatten.Verification
uv run pytest tests/->72 passedmake spec-test->127 scenarios passed