Repository navigation
Reject Yaml flow plain scalars starting with a dash and separation - #10284
Closed
effect-bot wants to merge 2 commits into
Closed
effect-bot wants to merge 2 commits into
effect-bot wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 49c0762 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
tim-smart
force-pushed
the
v4/next-minor
branch
from
November 3, 2026 20:54
2e13c53 to
5f5a4b3
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
7 times, most recently
from
November 3, 2026 22:52
97a1ee1 to
10d44ad
Compare
effect-bot
force-pushed
the
agent/effect-bot/eff-3232-flow-plain-dash
branch
from
November 3, 2026 23:14
a3daa68 to
6ea4d78
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
November 3, 2026 23:39
2650b53 to
0a68f11
Compare
effect-bot
force-pushed
the
agent/effect-bot/eff-3232-flow-plain-dash
branch
from
November 3, 2026 23:40
6ea4d78 to
738de7d
Compare
effect-bot
changed the base branch from
v4/next-minor
to
agent/effect-bot/eff-3232-literal-tab-escape
November 3, 2026 23:40
This was referenced Nov 3, 2026
Closed
effect-bot
force-pushed
the
agent/effect-bot/eff-3232-literal-tab-escape
branch
from
November 3, 2026 23:43
6104199 to
d99efdc
Compare
effect-bot
force-pushed
the
agent/effect-bot/eff-3232-flow-plain-dash
branch
from
November 3, 2026 23:43
738de7d to
49c0762
Compare
Contributor
Author
|
Superseded by #10287, which now holds the rest of the YAML expansion as one PR against |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
YAML 1.2.2 §7.3.3 (
ns-plain-first) lets a plain scalar in a flow collection start with-only when the next character is a non-space character other than a flow indicator.Yaml.parseandYaml.parseAlldidn't check this, so[- 1]gave["- 1"]and[1, -]gave[1, "-"].yaml2.9.1 and js-yaml 4.3.2 both reject these inputs.FlowParser.readPlainnow looks at the character after a leading-in the source, before the scalar is folded and trimmed. A space, a tab, the end of the line,,,[,],{or}fails with "A flow plain scalar cannot start with '-' followed by white space or a flow indicator". It covers items, values and keys.{-: 1},-1,-x,-#candb - cstill parse.The tests were added first in
b3e5bca7d6, and this PR doesn't change them.Validation
yaml2.9.1 and js-yaml 4.3.2: 31 dash shapes in 9 flow positions (items, keys, values, multiline collections, a flow collection inside a block sequence). Both references agreed on 270 of them, and this branch now matches 266 of those 270, up from 183. The 4 remaining differences, such as{-]: 1}, come from block-level handling of malformed flow keys. They behave the same before and after this change.pnpm lint-fixandpnpm jsdocs --checkpass.pnpm checkonly reports the existingapiStabilityLeakatcluster/ShardingRegistrationEvent.ts:67, which is also onv4/next-minor.Stack
These PRs form one stack. Each targets the PR before it, so its diff shows only its own stage. Merge them in this order:
Yaml.parseAllandResultfromYaml.parse(merged)v4/next-minorYaml.stringifyandYaml.stringifyAll, based on Resolve Yaml core schema tags #10285Yaml.parse, based on Add Yaml.stringify and Yaml.stringifyAll #10272After a PR in the stack is squash-merged, the next one has to be rebased onto the squash commit and retargeted to
v4/next-minorbefore it can merge.Closes EFF-3232