Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

tests: show issue 27 #31

Closed
wants to merge 5 commits into from
Closed

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented May 24, 2024

Close tox-dev/toml-fmt#7. Starting with tests. Not sure why only the Python one fails! Ah, [project] also has to be present.

The problem is that trailing whitespace is attached to the item. So a\n\n is moved around as a unit. I think it's tricky to solve nicely for all situations.

I think what makes sense is to preserve space around headings. So the only part given to the reorder is the chunk that starts with a non-space and ends with an entry.

(I'm referring to the part before running the normal run that limits spaces to one line, etc)

@henryiii henryiii force-pushed the henryiii/fix/27 branch 2 times, most recently from 86728a0 to 6d35a45 Compare May 24, 2024 06:27
@henryiii henryiii marked this pull request as draft May 24, 2024 06:40
@gaborbernat
Copy link
Member

@henryiii you still plan to work on this?

@henryiii
Copy link
Contributor Author

henryiii commented Jun 4, 2024

Yes, been busy with free-threading and other things lately, plus being sick for a few days. Probably later in the week. Don't wait on a release for this, though, as it's just making the formatting nicer after rearranging something that's out of order.

I think the nicest idea would be to always preserve whitespace above an element. If the whitespace was "stuck" to the next item, rather than the item before it, I think it would mostly come out nicer. But it take some work to both implement it, test it, and make sure it actually does make it a bit nicer.

@gaborbernat
Copy link
Member

@henryiii ping on this 😊

@henryiii
Copy link
Contributor Author

henryiii commented Jul 8, 2024

Will try soon! Have conjunctivitis at the moment so not on a computer much.

@gaborbernat
Copy link
Member

Ah, no worries, hope you get better soon!

@gaborbernat
Copy link
Member

@henryiii any updates?

@henryiii henryiii force-pushed the henryiii/fix/27 branch 2 times, most recently from 63c5920 to 009d817 Compare September 7, 2024 05:28
@henryiii
Copy link
Contributor Author

henryiii commented Sep 7, 2024

I've rebased the test, will try my suggested solution by early next week!

Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
@gaborbernat
Copy link
Member

@henryiii any updates here?

@gaborbernat
Copy link
Member

Moving this repository inside tox-dev/toml-fmt#1 to allow tox-toml-fmt, ruff-toml-fmt, etc. and avoid having the code in two repositories 😆

@gaborbernat
Copy link
Member

Needs moved to
Migrated into the toml-fmt repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Space is added on reordering
2 participants