feat(format/yaml): normalize scalar quotes - #11054
Conversation
|
✅ Organic activityNo automation signals detected in the analyzed events. This is an automated analysis by AgentScan |
0d9449f to
fb09118
Compare
| /// equivalent, so text with any other escape keeps its double quotes; a | ||
| /// backslash in a single quoted scalar is content that double quotes would | ||
| /// misread as an escape, so such text keeps its single quotes | ||
| fn normalize_quotes(value: &str, quote_style: QuoteStyle) -> Cow<'_, str> { |
There was a problem hiding this comment.
It would be great to have unit tests. Also, JS does this already, and its logic is battle-tested; we shouldn't re-invent the wheel, so maybe we should look at unifying the logic. Maybe with a new trait, like Denis created for CSS name casing.
There was a problem hiding this comment.
I'll add tests, but I think the trait would be good follow up work, after this PR. Seems like a larger refactor to me.
fb09118 to
e425f8c
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01472YxeN6U2t4LWfaqkieAv
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01472YxeN6U2t4LWfaqkieAv
e425f8c to
a5b9cdb
Compare
Summary
Implements the quote style formatter option
implemented by fable 5
Test Plan
updated snapshots
Docs