noir icon indicating copy to clipboard operation
noir copied to clipboard

Document `noirfmt.toml`

Open michaeljklein opened this issue 5 months ago • 0 comments

Problem

noirfmt.toml is undocumented, but can be configured with the following options:

config! {
    max_width: usize, 100, "Maximum width of each line";
    tab_spaces: usize, 4, "Number of spaces per tab";
    remove_nested_parens: bool, true, "Remove nested parens";
    error_on_lost_comment: bool, false, "Error if unable to get comments";
    short_array_element_width_threshold: usize, 10, "Width threshold for an array element to be considered short";
    array_width: usize, 100, "Maximum width of an array literal before falling back to vertical formatting";
    fn_call_width: usize, 60, "Maximum width of the args of a function call before falling back to vertical formatting";
    single_line_if_else_max_width: usize, 50, "Maximum line length for single line if-else expressions";
}

Happy Case

Document how to use noirfmt.toml, its allowed fields, and defaults

Workaround

Yes

Workaround Description

Read the code for nargo_fmt/src/config.rs

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

michaeljklein avatar Sep 23 '24 21:09 michaeljklein