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

[Tracking] Finish vertical formatting in sfv2 #2493

Closed
5 tasks done
eureka-cpu opened this issue Aug 9, 2022 · 1 comment
Closed
5 tasks done

[Tracking] Finish vertical formatting in sfv2 #2493

eureka-cpu opened this issue Aug 9, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request forc formatter good first issue Good for newcomers
Milestone

Comments

@eureka-cpu
Copy link
Contributor

eureka-cpu commented Aug 9, 2022

Currently only structs and tuples are handled for multiline formatting. That still leaves:

if really_long_var_name > other_really_long_var || really_long_var_name <= 0 && other_really_long_var != 0 { ... }

should be:

if really_long_var_name > other_really_long_var
    || really_long_var_name <= 0 
    && other_really_long_var != 0
{
    ...
}
fn foo(really_long_var: String, other_really_long_var: String, hi_its_another_long_var: String) -> Result<(), Error> { ... }

should be:

fn foo(
really_long_var: String,
other_really_long_var: String,
hi_its_another_long_var: String,
) -> Result<(), Error> {
    ...
}
@eureka-cpu eureka-cpu added enhancement New feature or request good first issue Good for newcomers forc formatter labels Aug 9, 2022
@eureka-cpu eureka-cpu added this to the swayfmt-v2 milestone Aug 9, 2022
@eureka-cpu eureka-cpu changed the title Add vertical formatting for remaining expressions in sfv2 [Tracking] Finish vertical formatting in sfv2 Aug 9, 2022
@eureka-cpu eureka-cpu self-assigned this Aug 31, 2022
@Braqzen
Copy link
Contributor

Braqzen commented Sep 21, 2022

Additional comment for params in version 0.24.4.

The following code

fn claim(
    amount: u64,
    key: u64,
    num_leaves: u64,
    proof: [b256; 2],
    to: Identity,
);

turns into

fn claim(amount: u64, key: u64, num_leaves: u64, proof: [b256; 2], to: Identity, );

instead of the preferred

fn claim(amount: u64, key: u64, num_leaves: u64, proof: [b256; 2], to: Identity);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc formatter good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants