Open jamesbraza opened 3 months ago
Unfortunately that is a limitation of the underlying toml-edit
library. The actual source of the issue though from where I'm standing is that using a massive array for dependencies is always going to cause problems for tools like rye when they poke around in toml files as the "meaningful" comment is basically after the comma so on the next item.
Thanks for the response, I hear what you're saying. I wonder if toml-sort
can come to the rescue here, so I made https://github.com/pappasam/toml-sort/issues/70
Steps to Reproduce
Before running
rye add
, here is part of mypyproject.toml
:Then running
rye add --dev ipython
, it becomes:We can see the inline comments were auto wrapped to the next line, which is undesirable
Also more of an aside (that can be auto-fixed by https://github.com/pappasam/toml-sort),
rye add
didn't respect the alphabetization of my dependencies.Expected Result
Not moving inline TOML comments
Actual Result
Rye moved inline TOML comments to the next line
Version Info
rye 0.36.0 commit: 0.36.0 (2024-07-07) platform: macos (aarch64) self-python: cpython@3.12.3 symlink support: true uv enabled: true
Stacktrace
No response