Skip to content

Fix async/sync behavioral inconsistency for top-level !ignore documents#18

Merged
ryodine merged 2 commits intofeat/ignorefrom
copilot/sub-pr-17
Mar 8, 2026
Merged

Fix async/sync behavioral inconsistency for top-level !ignore documents#18
ryodine merged 2 commits intofeat/ignorefrom
copilot/sub-pr-17

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

loadAndResolveSync returned undefined for a top-level !ignore document while loadAndResolve returned null, breaking public API consistency between the two variants.

Changes

  • src/resolver.ts: Added early-return null guard in loadAndResolveSync for undefined/null parsed roots, matching the existing check in loadAndResolve
  • test/ignore.test.ts: Added test covering loadYamlWithReferencesSync returning null for a top-level !ignore document
// Before: inconsistent results for the same input
await loadYamlWithReferences("ignored.yaml");  // null  ✓
      loadYamlWithReferencesSync("ignored.yaml");  // undefined  ✗

// After: consistent
await loadYamlWithReferences("ignored.yaml");  // null  ✓
      loadYamlWithReferencesSync("ignored.yaml");  // null  ✓

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…ll/undefined

Co-authored-by: ryodine <5068378+ryodine@users.noreply.github.com>
Copilot AI changed the title [WIP] Update implementation for ignore tag support feedback Fix async/sync behavioral inconsistency for top-level !ignore documents Mar 8, 2026
@ryodine ryodine self-requested a review March 8, 2026 21:05
@ryodine ryodine marked this pull request as ready for review March 8, 2026 21:05
@ryodine ryodine merged commit bc60e4b into feat/ignore Mar 8, 2026
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