feat: add full support for TOML 1.1#6500
Conversation
|
You seem to have covered the success-cases very successfully. Good work:-) I think I found some corner-cases that still need fixing. Take a look at this This command breaks the file:
Doing removes the comment I did miss e.g. feature removal. Is that covered already? Should that be covered? |
493de53 to
e8bc4fc
Compare
…diting manifests Stress-testing the TOML 1.1 editing helpers surfaced several problems: - removing an entry that precedes a dotted key left the dead entry's line comment dangling and dropped standalone comments, because a dotted key's line decor lives on its leaf key rather than the root segment - overwriting a dotted entry collapsed its line and ate the previous entry's comment - standalone comment lines stored in a removed entry's suffix (multiline containers without a trailing comma) were deleted - removing an entry from a regular table deleted the standalone comments above it - pixi remove looked up conda and pypi dependencies by the spelling the user typed, silently leaving differently spelled entries (hTTPx vs httpx, PyYAML vs pyyaml) in the document while reporting success - pixi global add/remove looked up dependencies only under the normalized name, duplicating or missing differently spelled entries, and channel deduplication compared raw strings so URL channels with a trailing slash were added twice - removing a pypi dependency panicked on pyproject dependency arrays that contain entries that are not valid pep508 strings The new stress test crosses a corpus of hostile-but-valid TOML formatting variants with every editing operation and checks that the output stays valid TOML, matches a semantic model, and preserves comments according to the crate's contract.
Handle CRLF line endings when checking whether decor starts on a fresh
line, so removing an entry no longer deletes the comments of surviving
entries in CRLF manifests. Keep the previous line's trailing comment in
place when inserting an array element, and keep standalone comment
lines on their own lines instead of flattening them behind the last
element when appending to arrays and inline tables.
Compare channels by their display name in add_channels so re-adding a
URL channel that only differs in spelling replaces the parsed entry
like it replaces the document entry. Recognize inline table entries
like { channel = "nvidia", priority = 1 } when checking whether a
channel is already listed in a pixi global manifest.
Description
Fixes #6387
How Has This Been Tested?
AI Disclosure
Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}
Checklist:
schema/model.py.