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

Improve forc-fmt to format std lib and core #5410

Merged
merged 15 commits into from
Dec 21, 2023

Conversation

crodas
Copy link
Contributor

@crodas crodas commented Dec 19, 2023

Description

Changes needed to build #5404 and #5405

Improvements

  1. Use byte-offset instead of chars offset
  2. Enhanced asm formatting

Better output when tests fail

image

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@crodas crodas self-assigned this Dec 19, 2023
@crodas crodas mentioned this pull request Dec 19, 2023
7 tasks
@crodas crodas changed the title Fix wrong new line with UTF-8 bytes Improve forc-fmt to format std lib and core Dec 19, 2023
crodas added a commit that referenced this pull request Dec 19, 2023
crodas added a commit that referenced this pull request Dec 19, 2023
crodas added a commit that referenced this pull request Dec 19, 2023
crodas added a commit that referenced this pull request Dec 19, 2023
crodas added a commit that referenced this pull request Dec 19, 2023
crodas added a commit that referenced this pull request Dec 21, 2023
crodas added a commit that referenced this pull request Dec 21, 2023
@crodas crodas requested a review from a team December 21, 2023 05:23
@crodas crodas marked this pull request as ready for review December 21, 2023 05:23
@crodas crodas enabled auto-merge (squash) December 21, 2023 05:24
kayagokalp
kayagokalp previously approved these changes Dec 21, 2023
Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

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

nice, left a nit

swayfmt/tests/mod.rs Outdated Show resolved Hide resolved
kayagokalp
kayagokalp previously approved these changes Dec 21, 2023
Cesar Rodas and others added 7 commits December 21, 2023 17:55
Most codes work fine with byte-offsets instead of char offsets (not
always one char offset is equal to one byte offset). Non ascii character
usually appears inside strings and comments and it was messing up the
offsets from that point forward
@crodas crodas force-pushed the fmt-improvements-std-lib-core branch from 4550c29 to 7ab743e Compare December 21, 2023 21:32
crodas added a commit that referenced this pull request Dec 21, 2023
crodas added a commit that referenced this pull request Dec 21, 2023
@crodas crodas requested review from a team, sdankel and kayagokalp December 21, 2023 21:33
crodas added a commit that referenced this pull request Dec 21, 2023
sdankel
sdankel previously approved these changes Dec 21, 2023
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

JoshuaBatty
JoshuaBatty previously approved these changes Dec 21, 2023
Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@crodas crodas merged commit d353371 into master Dec 21, 2023
29 checks passed
@crodas crodas deleted the fmt-improvements-std-lib-core branch December 21, 2023 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter lib: core Core library lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants