Skip to content

Write the closing quote when appending a synthesized license field - #319

Merged
Jake-Shadle merged 1 commit into
EmbarkStudios:mainfrom
devtechedge:synth-license-quote
Sep 18, 2026
Merged

Jake-Shadle merged 1 commit into
EmbarkStudios:mainfrom
devtechedge:synth-license-quote

Conversation

@devtechedge

Copy link
Copy Markdown
Contributor

Fixes #315.

synthesize_manifest takes the append path when a [package] table runs to the end of the manifest, with no blank line and no following table to insert before.

That path wrote license = " followed by the expression but never wrote the closing quote, so the synthesized manifest contained license = "MIT and was not valid TOML.

This writes the closing quote, matching the sibling branch that synthesizes an entire manifest, which already terminates the value.

The expression offset is unchanged, so diagnostics still point at the start of the expression.

src/licenses/resolution.rs had no unit tests, so this adds one covering the append path.

It fails before the change with license = "MIT and passes after.

Verified locally with cargo test --features cli and cargo fmt --check.

cargo clippy --all-targets --features cli is clean apart from one pre-existing collapsible_if in is_powershell_parent, which this change does not touch.

devtechedge added a commit to devtechedge/oss-contributions that referenced this pull request Sep 16, 2026
synthesize_manifest appended license = "<expression> without the closing
quote, so the synthesized manifest was not valid TOML.

Fixes #315
@Jake-Shadle
Jake-Shadle merged commit d7c169d into EmbarkStudios:main Sep 18, 2026
14 checks passed
@devtechedge

Copy link
Copy Markdown
Contributor Author

Appreciate the merge, @Jake-Shadle.

This one was a small lesson in how the append path through synthesize_manifest differs from the whole-manifest branch, and why that missing closing quote broke the TOML.

Happy the first unit test module in resolution.rs could lock it in.

Thanks for keeping cargo-about in such good shape.

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.

synthesize_manifest produces invalid TOML when appending a synthesized license field

2 participants