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

fix(graphql_formatter): panic in block comments with empty line #3993

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

vohoanglong0107
Copy link
Contributor

Summary

Fixes #3924
Previously the formatter tried to format block comments by removing the indentation in those comments, but it forgot to take empty lines into account when calculating and subtracting the indent level.

Also allows the formatter to format line with only spaces and tabs

Test Plan

Added a new test containing block comment with empty lines and lines with only white spaces

@vohoanglong0107 vohoanglong0107 requested a review from a team September 19, 2024 13:09
@github-actions github-actions bot added the A-Formatter Area: formatter label Sep 19, 2024
@ematipico ematipico requested a review from a team September 19, 2024 13:17
@vohoanglong0107 vohoanglong0107 marked this pull request as ready for review September 19, 2024 13:38
Copy link

codspeed-hq bot commented Sep 19, 2024

CodSpeed Performance Report

Merging #3993 will degrade performances by 35.79%

Comparing vohoanglong0107:fix-3924 (7cde444) with main (1a87927)

Summary

⚡ 1 improvements
❌ 2 regressions
✅ 104 untouched benchmarks

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

Benchmarks breakdown

Benchmark main vohoanglong0107:fix-3924 Change
big5-added_15586211152145260264.json[uncached] 546.7 µs 851.5 µs -35.79%
db_17847247775464589309.json[cached] 13.9 ms 12.7 ms +9.74%
eucjp_1600564308684076393.json[uncached] 974.1 µs 1,249.5 µs -22.04%

@Conaclos
Copy link
Member

LGTM. Could you add a changelog entry?

@ematipico ematipico merged commit c696bd7 into biomejs:main Sep 20, 2024
11 of 12 checks passed
@vohoanglong0107 vohoanglong0107 deleted the fix-3924 branch September 21, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📝 Empty line with no indentation between strings in comment: .graphql files
3 participants