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

Weird formatting in require #6618

Open
Lukasz2891 opened this issue Oct 7, 2024 · 0 comments
Open

Weird formatting in require #6618

Lukasz2891 opened this issue Oct 7, 2024 · 0 comments
Labels
bug Something isn't working formatter triage This issue was opened with a template and needs to be triaged by code owners.

Comments

@Lukasz2891
Copy link

Related Component

forc-fmt

Problem

library;

enum LibraryError {
    QuiteLongLibraryErrorCase: (u64, u64, bool),
}

fn test_formatter() {
    let vec = Vec::new();

    require(vec.len() > 0, LibraryError::QuiteLongLibraryErrorCase((120000, 150000, true)));
}

is formatted to

library;

enum LibraryError {
    QuiteLongLibraryErrorCase: (u64, u64, bool),
}

fn test_formatter() {
    let vec = Vec::new();

    require(
        vec
            .len() > 0,
        LibraryError::QuiteLongLibraryErrorCase((120000, 150000, true)),
    );
}

but should be to

library;

enum LibraryError {
    QuiteLongLibraryErrorCase: (u64, u64, bool),
}

fn test_formatter() {
    let vec = Vec::new();

    require(
        vec.len() > 0,
        LibraryError::QuiteLongLibraryErrorCase((120000, 150000, true)),
    );
}

Steps

Use the code as above

Possible Solution(s)

No response

Notes

No response

Installed components

test_contract git:(issues) ✗ forc fmt --version
forc-fmt 0.65.2
@Lukasz2891 Lukasz2891 added bug Something isn't working triage This issue was opened with a template and needs to be triaged by code owners. labels Oct 7, 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 formatter triage This issue was opened with a template and needs to be triaged by code owners.
Projects
None yet
Development

No branches or pull requests

2 participants