Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserving pyproject.toml formatting #10

Open
cnpryer opened this issue Apr 25, 2023 · 2 comments
Open

Preserving pyproject.toml formatting #10

cnpryer opened this issue Apr 25, 2023 · 2 comments

Comments

@cnpryer
Copy link
Contributor

cnpryer commented Apr 25, 2023

Description

Off the top of my head, I'm assuming this is more of an upstream toml behavior. I know there's a "preserve_order" feature, but I'm not certain if that fully addresses this issue. I'd be happy to move this upstream if that's where the fix needs to be made.

Right now as I understand it, there's no preservation of the toml file's original format, even with the "preserve_order" feature. I'm pretty certain that feature is meant for data structures like HashMap vs IndexMap, but it doesn't effect how a struct's attributes are ordered during its serialization.

Request

Preserve original formatting of the toml file. Could be feature-gated as well. Currently I personally only need table order preservation, but I plan to collect feedback on this over time (for my project) so that may change.


To be completely transparent, I have a few things I'd like to complete and then I'd be more than happy to work on this if you're okay with the change.

@messense
Copy link
Member

Feel free to send PRs.

@adamreichold
Copy link
Member

toml_edit which powers Cargo's modification features (and toml behind the scenes) might be be helpful for this.

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

No branches or pull requests

3 participants