Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for the YAML !ignore tag, matching the referenced spec, so ignored nodes/documents are erased from parsed output while still allowing anchor extraction when requested.
Changes:
- Introduces
!ignorecustom YAML tag handling and JS post-processing to drop ignored nodes (maps, seqs, scalars, and root documents). - Updates resolver semantics to treat top-level ignored documents as
nullon load, and to omit ignored files from!reference-all. - Adds a comprehensive Jest test suite covering parser + resolver behavior for
!ignore.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/ignore.test.ts | New end-to-end tests validating parser/resolver behavior for !ignore, including anchor/alias interactions. |
| src/Ignore.ts | Implements YAML custom tags and runtime markers for !ignore nodes. |
| src/parser.ts | Registers !ignore tags and drops ignored nodes during processParsedDocument. |
| src/resolver.ts | Treats top-level ignored docs as null on async load and skips undefined entries in !reference-all results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const parsed = await parseYamlWithReferences(filePath); | ||
| if (parsed === undefined || parsed === null) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
loadAndResolve now coerces a top-level parsed undefined (from !ignore) to null, but loadAndResolveSync does not. This makes loadYamlWithReferences and loadYamlWithReferencesSync behave differently for the same !ignore document (async returns null, sync returns undefined). Align the sync implementation (e.g., early-return null for undefined/null parsed roots) so the public API is consistent across async/sync variants.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
…ents (#18) * Initial plan * Align loadAndResolveSync with loadAndResolve for !ignore top-level null/undefined Co-authored-by: ryodine <5068378+ryodine@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ryodine <5068378+ryodine@users.noreply.github.com>
Implements
!ignoretag as specified in dsillman2000/yaml-reference-specs#27