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

bug: long comments format inserts unwanted extra lines infintely #5905

Closed
enitrat opened this issue Jun 26, 2024 · 0 comments · Fixed by #5906
Closed

bug: long comments format inserts unwanted extra lines infintely #5905

enitrat opened this issue Jun 26, 2024 · 0 comments · Fixed by #5906
Labels
bug Something isn't working

Comments

@enitrat
Copy link
Contributor

enitrat commented Jun 26, 2024

Bug Report

Cairo version:
scarb 2.6.4+nightly-2024-06-26 -> cairo: 2.6.4 (78777e38e) 78777e3

Consider the following code, with a long link as a comment:

// my comment has a link is very long https://github.com/aurora-is-near/aurora-engine/blob/1213f2c7c035aa523601fced8f75bef61b4728ab/engine-modexp/src
fn foo(){

}

running scarb fmt will turn it into

// my comment  has a link that is very long
// 
// https://github.com/aurora-is-near/aurora-engine/blob/1213f2c7c035aa523601fced8f75bef61b4728ab/engine-modexp/src
fn foo() {}

running again:

// my comment has a link that is very long
//
//
//
// https://github.com/aurora-is-near/aurora-engine/blob/1213f2c7c035aa523601fced8f75bef61b4728ab/engine-modexp/src
fn foo() {}

-> if the width of a comment line is bigger than a defined threshold, the formatter will attempt to split it and add empty new lines infinitely.

@enitrat enitrat added the bug Something isn't working label Jun 26, 2024
@enitrat enitrat changed the title bug: long comments format inserts unwanted extra lines bug: long comments format inserts unwanted extra lines infintely Jun 26, 2024
orizi added a commit that referenced this issue Jun 26, 2024
orizi added a commit that referenced this issue Jun 26, 2024
orizi added a commit that referenced this issue Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant