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

feat(format/grit): add formatting for lists #4378

Merged
merged 4 commits into from
Nov 5, 2024
Merged

Conversation

branberry
Copy link
Contributor

@branberry branberry commented Oct 25, 2024

Summary

Basic formatting for Grit lists.

#2476

Test Plan

Snapshots demonstrate correct formatting of lists

@github-actions github-actions bot added A-Formatter Area: formatter L-Grit Language: GritQL labels Oct 25, 2024
Copy link

codspeed-hq bot commented Oct 25, 2024

CodSpeed Performance Report

Merging #4378 will degrade performances by 6.13%

Comparing branberry:main (42da1eb) with main (7627ab0)

Summary

❌ 1 regressions
✅ 98 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main branberry:main Change
pure_9395922602181450299.css[uncached] 4 ms 4.2 ms -6.13%

`var $x = [$numbers]`=>`var firstPrimes = [$numbers]`where{$numbers<:[`2`,`3`,`5`]}


`var $x = [$numbers]`=>`var firstPrimes = [$numbers]`where{$numbers<:[`2`,`3`,`5`,`6`,`7`,`8`]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding also long lists that go over the default line width, so you can see how it behaves.

For example, here you used .fill, which doesn't - if memory serves me right - breakdown the lists on multiple lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct. I'll update the tests to go over the default line length, and refactor the code so that it breaks down the list on multiple lines once it reaches a certain length.

Thank you!

@ematipico ematipico merged commit 50093fb into biomejs:main Nov 5, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-Grit Language: GritQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants