fix(fmt): align singleBodyPosition schema values#34304
Conversation
Deno Individual Contributor License AgreementAll contributors have signed the CLA. Thank you! This is an automated message from CLA Assistant |
fibibot
left a comment
There was a problem hiding this comment.
The schema fix matches the formatter config surface: singleBodyPosition is accepted in repo tests with maintain, sameLine, and nextLine, and sameLineUnlessHanging now only remains under bracePosition. No code issue found; holding approval until the CLA is signed and CI runs.
lunadogbot
left a comment
There was a problem hiding this comment.
No code issue found. singleBodyPosition now matches SingleBodyPosition::{Maintain, SameLine, NextLine}, and sameLineUnlessHanging remains available only under bracePosition where the Rust config enum supports it. Holding approval until the CLA check is green.
fibibot
left a comment
There was a problem hiding this comment.
The schema still matches the Rust config enum: singleBodyPosition now accepts only maintain, sameLine, and nextLine, while sameLineUnlessHanging remains under bracePosition. CLA is green now; holding approval until build/test CI runs on this head.
lunadogbot
left a comment
There was a problem hiding this comment.
CLA is green now. The schema still matches SingleBodyPosition::{Maintain, SameLine, NextLine} and leaves sameLineUnlessHanging only under bracePosition; holding approval until build/test CI runs on this head.
fibibot
left a comment
There was a problem hiding this comment.
CI is green now, promoting prior review to APPROVE.
|
@bartlomieju this is ready to merge |
bartlomieju
left a comment
There was a problem hiding this comment.
Nice catch on the schema bug. The enum fix is correct — I verified sameLineUnlessHanging is genuinely invalid here: deno_config's SingleBodyPosition enum has only maintain/sameLine/nextLine (and it's deny_unknown_fields), and the underlying dprint type SameOrNextLinePosition has the same three. sameLineUnlessHanging belongs to bracePosition, not this field.
One thing to fix before this lands (inline): the new default value isn't right either. See the comment on the default line.
For reference, the schema default is advisory (editor hints/autocomplete), so this isn't a functional formatting bug — but since the PR is specifically about aligning the schema with what the parser accepts, getting the default accurate matters. Everything else (title, linked issue, CLA, AI disclosure, scope) looks good.
Signed-off-by: Bartek Iwańczuk <[email protected]>
Fixes #34289
Summary
sameLineUnlessHangingvalue from thefmt.singleBodyPositionJSON schema enumsameLine, which is accepted by the config parserTests
jq empty cli/schemas/config-file.v1.jsondeno fmt --check cli/schemas/config-file.v1.jsonjq -e '.properties.fmt.properties.singleBodyPosition.default == "sameLine" and ((.properties.fmt.properties.singleBodyPosition.enum | index("sameLineUnlessHanging")) == null)' cli/schemas/config-file.v1.json\n-cargo test -p deno_config deno_json::tests::test_parse_config\n\n## AI assistance\nThis PR was prepared with assistance from OpenAI Codex.