Skip to content

More YAML parse fixes#587

Merged
biojppm merged 17 commits intomasterfrom
fix/test_suite
Apr 11, 2026
Merged

More YAML parse fixes#587
biojppm merged 17 commits intomasterfrom
fix/test_suite

Conversation

@biojppm
Copy link
Copy Markdown
Owner

@biojppm biojppm commented Mar 31, 2026

This PR continues the previous work from #586 and #585.

The changeset is gigantic, but the overwhelming majority of it is adding new tests, as well as moving tests across different test files when they become too large for compilation.

There are no API changes, and the relevant changes are all internal to the parser.

The PR address many existing YAML issues, notably:

  • Fix parsing of valid YAML corner cases:
    • Ensure tags/anchors are not omitted. This was happening in some flow maps.
    • Ambiguity of tags/anchors in ? mode:
      ? &mapanchor
        key: val
      ?
        &keyanchor key: val
    • flow tags/anchors with omitted plain scalar:
      # ... likewise for !tag
      - [&anchor,&anchor]
      - {&anchor,&anchor}
      - [&anchor :,&anchor :]
      - {&anchor :,&anchor :}
      - [: &anchor,: &anchor]
      - {: &anchor,: &anchor}
      ---
      ? anchor

  • Ensure parse errors for invalid YAML cases, and improve reported location:
    • doc start/begin tokens at zero indentation in seq flow:
      [
      ---,
      --- ,
      ---\t,
      ...,
      ... ,
      ...\t,
      # etc
      ]
    • nested flow containers now enforce the contextual parent indentation:
      - - - [
          a  # now this is a parse error
           ]
      - - - [
           a  # this is ok
           ]
    • single/double-quoted scalars now enforce the contextual parent indentation:
      - - - "a
          b"  # now this is a parse error
    • plain scalars in block mode starting with ,:
      all invalid:
        - , foo
        - ,foo
        - ,
    • references with anchors or tags:
      all invalid:
        - &anchor *ref
        - !tag *ref

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.50%. Comparing base (c842cf7) to head (b076d39).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #587      +/-   ##
==========================================
+ Coverage   97.70%   98.50%   +0.79%     
==========================================
  Files          46       46              
  Lines       13790    13948     +158     
==========================================
+ Hits        13474    13739     +265     
+ Misses        316      209     -107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@biojppm biojppm force-pushed the fix/test_suite branch 4 times, most recently from 307d025 to 9a9fbb4 Compare April 7, 2026 19:30
@biojppm biojppm force-pushed the fix/test_suite branch 2 times, most recently from b70182e to b77fb17 Compare April 8, 2026 21:17
@biojppm biojppm changed the title Ensure parse errors on more invalid YAML cases More YAML parse fixes Apr 8, 2026
@biojppm biojppm force-pushed the fix/test_suite branch 10 times, most recently from b97c522 to c923836 Compare April 11, 2026 13:58
@biojppm biojppm merged commit 3a2bbd9 into master Apr 11, 2026
366 of 367 checks passed
@biojppm biojppm deleted the fix/test_suite branch April 11, 2026 21:16
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.

1 participant