Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_formatter): format import syntax #1992

Merged
merged 20 commits into from
Jan 31, 2022
Merged

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Jan 24, 2022

Summary

This PR formats the whole import ... syntax.

I took the liberty to create a new format_list API inside the Formatter, where there was some repeated pattern. The documentation is not the best to be honest, it would be great if someone else would suggest something more to it.

There's an existing issue where a trailing comment is not well positioned in some cases. I reproduced this issue also with existing grammar, so it would be better to fix it with another PR so to not add too much to this PR.

Test Plan

Added various tests, with long variables and comments.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 24, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 332e184
Status: ✅  Deploy successful!
Preview URL: https://41ea80cf.tools-8rn.pages.dev

View logs

Base automatically changed from chore/better-format-testing to main January 25, 2022 13:02
@ematipico ematipico force-pushed the feature/format-import-export branch from 223b194 to e09f855 Compare January 25, 2022 13:56
@github-actions
Copy link

github-actions bot commented Jan 25, 2022

Test262 comparison coverage results on ubuntu-latest

Test result main count This PR count Difference
Total 45250 45250 0
Passed 44129 44129 0
Failed 1120 1120 0
Panics 1 1 0
Coverage 97.52% 97.52% 0.00%

@ematipico ematipico force-pushed the feature/format-import-export branch 3 times, most recently from 51ebdbb to ebf352c Compare January 25, 2022 17:08
@ematipico ematipico marked this pull request as ready for review January 25, 2022 17:18
@ematipico ematipico changed the title feat: format import syntax feat(rome_formatter): format import syntax Jan 25, 2022
@ematipico ematipico force-pushed the feature/format-import-export branch from 577cf56 to 5ead0f9 Compare January 26, 2022 13:35
@ematipico ematipico force-pushed the feature/format-import-export branch from d0d3997 to 939dde6 Compare January 28, 2022 09:06
@ematipico ematipico force-pushed the feature/format-import-export branch from 939dde6 to ee06d00 Compare January 31, 2022 08:50
@github-actions
Copy link

github-actions bot commented Jan 31, 2022

Parser conformance results on ubuntu-latest

TS

Test result main count This PR count Difference
Total 15976 15976 0
Passed 10473 10473 0
Failed 4153 4153 0
Panics 1350 1350 0
Coverage 65.55% 65.55% 0.00%

T262

Test result main count This PR count Difference
Total 45250 45250 0
Passed 44130 44130 0
Failed 1120 1120 0
Panics 0 0 0
Coverage 97.52% 97.52% 0.00%

@ematipico ematipico force-pushed the feature/format-import-export branch from 9597d78 to 9f51206 Compare January 31, 2022 09:06
@ematipico ematipico force-pushed the feature/format-import-export branch from 6e970ae to adab3ce Compare January 31, 2022 10:21
@ematipico ematipico force-pushed the feature/format-import-export branch 2 times, most recently from 2008e7e to 726243d Compare January 31, 2022 11:36
@ematipico ematipico force-pushed the feature/format-import-export branch from 726243d to ed1bcd7 Compare January 31, 2022 11:42
@ematipico ematipico requested a review from leops January 31, 2022 13:43
@ematipico ematipico merged commit 9a7baf0 into main Jan 31, 2022
@ematipico ematipico deleted the feature/format-import-export branch January 31, 2022 14:15
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.

4 participants