Skip to content

Preserve controls when writing quoted and multiline YAML strings - #258

Merged
quinnj merged 2 commits into
masterfrom
maintenance/escaped-block-strings
Oct 4, 2026
Merged

quinnj merged 2 commits into
masterfrom
maintenance/escaped-block-strings

Conversation

@quinnj

@quinnj quinnj commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Writing a string containing a quote or newline selects a literal block and bypasses escaping. With a NUL character, reading that output silently truncates the value; other control characters produce illegal YAML or can normalize line endings/change the value.

Use literal blocks only when non-printable characters are LF or TAB. For other controls, reuse the existing escaped double-quoted output. Ordinary printable multiline strings and quoted strings containing tabs retain their block formatting. The guard follows the YAML character-set requirements.

Validation:

  • The 140 public output-validity and scalar/list/map/file checks have 80 passes, 28 failures and 32 errors on the preceding master; all pass with the fix. Cases include NUL, C0/C1 controls, DEL, CR/NEL, and Unicode separators in both quote-containing and multiline strings. Four additional checks preserve ordinary block formatting and roundtrips (144 new checks total).
  • Full integrated Julia 1.6.7 and 1.13.0 suites pass with four threads and forced bounds checks, including all merged key/folding regressions. git diff --check passes.
  • An independent review of the actual writer control flow and all 144 tests found no blockers. The earlier independent 1,458 Unicode/backslash roundtrips also support the reused escape path.
  • All 22 exact-head checks pass in run 37182618280, including all 20 minimum/current/nightly Julia jobs on Linux, Windows and Intel macOS. The stable Linux upload was accepted at the correct repository/commit (11,236 bytes), and all 20 coverage sessions finished at 87.57%; both coverage checks passed.

Exact master merge 82ca3c84b4296e86209dd25907aed557697dd3f9 also passes all 20 jobs in run 37183435713. The stable Linux upload was accepted at the correct destination (11,240 bytes), with all 20 sessions processed at 87.57%.

No dependencies, schema changes, exports, or version changes.

Co-authored by Codex

AI disclosure: This work was prepared with assistance from OpenAI Codex.

quinnj added 2 commits October 4, 2026 00:12
Use literal block output only when non-printable characters are LF or TAB. Preserve other controls through the existing escaped YAML string path instead of emitting invalid characters or normalizing/truncating values. Cover 144 public output-validity/roundtrip/format checks.

AI disclosure: This work was prepared with assistance from OpenAI Codex.
Preserve the complete 52 folding and 144 writer-control checks when incorporating current master. The writer guard is unchanged.

AI disclosure: This work was prepared with assistance from OpenAI Codex.
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.57%. Comparing base (a3a5213) to head (2c46dd2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #258   +/-   ##
=======================================
  Coverage   87.56%   87.57%           
=======================================
  Files          15       15           
  Lines        1649     1650    +1     
=======================================
+ Hits         1444     1445    +1     
  Misses        205      205           

☔ View full report in Codecov by Harness.
📢 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.

@quinnj
quinnj merged commit 82ca3c8 into master Oct 4, 2026
22 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.

1 participant