# max_width # Default: 100 # Maximum width of each line # hard_tabs # Default: false # Use tab characters for indentation, spaces for alignment # tab_spaces # Default: 4 # Number of spaces per tab # newline_style # [Windows|Unix|Native] Default: Unix # Unix or Windows line endings # indent_style # [Visual|Block] Default: Block # How do we indent expressions or items. # use_small_heuristics # Default: true # Whether to use different formatting for items and expressions if they satisfy a heuristic notion of 'small'. # format_strings = true # Default: false # Format string literals where necessary # wrap_comments = true # Default: false # Break comments to fit on the line # comment_width = 100 # Default: 80 # Maximum length of comments. No effect unless wrap_comments = true # normalize_comments = false # Default: false # Convert /* */ comments to // comments where possible # empty_item_single_line # Default: true # Put empty-body functions and impls on a single line # struct_lit_single_line # Default: true # Put small struct literals on a single line # fn_single_line = true # Default: false # Put single-expression functions on a single line # where_single_line # Default: false # To force single line where layout # imports_indent # [Visual|Block] Default: Visual # Indent of imports # imports_layout # [Vertical|Horizontal|HorizontalVertical|Mixed] Default: Mixed # Item layout inside a import block # reorder_extern_crates # Default: true # Reorder extern crate statements alphabetically # reorder_extern_crates_in_group # Default: true # Reorder extern crate statements in group # reorder_imports # Default: false # Reorder import statements alphabetically # reorder_imports_in_group # Default: false # Reorder import statements in group # reorder_imported_names # Default: true # Reorder lists of names in import statements alphabetically # binop_separator # [Front|Back] Default: Front # Where to put a binary operator when a binary expression goes multiline. # type_punctuation_density # [Compressed|Wide] Default: Wide # Determines if '+' or '=' are wrapped in spaces in the punctuation of types # space_before_colon # Default: false # Leave a space before the colon # space_after_colon # Default: true # Leave a space after the colon # spaces_around_ranges # Default: false # Put spaces around the .. and ... range operators # spaces_within_parens_and_brackets # Default: false # Put spaces within non-empty parentheses or brackets # combine_control_expr # Default: true # Combine control expressions with function calls. # struct_field_align_threshold # Default: 0 # Align struct fields if their diffs fits within threshold. # remove_blank_lines_at_start_or_end_of_block # Default: true # Remove blank lines at start or end of a block # same_line_attributes # Default: true # Try to put attributes on the same line as fields and variants. # match_arm_blocks # Default: true # Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms # force_multiline_blocks # Default: false # Force multiline closure bodies and match arms to be wrapped in a block # fn_args_density # [Compressed|Tall|Vertical] Default: Tall # Argument density in functions # brace_style # [AlwaysNextLine|PreferSameLine|SameLineWhere] Default: SameLineWhere # Brace style for items # control_brace_style # [AlwaysSameLine|ClosingNextLine|AlwaysNextLine] Default: AlwaysSameLine # Brace style for control flow constructs # trailing_comma # [Always|Never|Vertical] Default: Vertical # How to handle trailing commas for lists # trailing_semicolon # Default: true # Add trailing semicolon after break, continue and return # match_block_trailing_comma # Default: false # Put a trailing comma after a block based match arm (non-block arms are not affected) # blank_lines_upper_bound # Default: 1 # Maximum number of blank lines which can be put between items. # blank_lines_lower_bound # Default: 0 # Minimum number of blank lines which must be put between items. # merge_derives # Default: true # Merge multiple `#[derive(...)]` into a single one use_try_shorthand = true # Default: false # Replace uses of the try! macro by the ? shorthand # condense_wildcard_suffixes # Default: false # Replace strings of _ wildcards by a single .. in tuple patterns # force_explicit_abi # Default: true # Always print the abi for extern items # write_mode # [Replace|Overwrite|Display|Diff|Coverage|Plain|Checkstyle] Default: Overwrite # Write Mode to use when none is supplied # color # [Always|Never|Auto] Default: Auto # Color option to use when none is supplied # required_version # Default: "0.3.3" # Require a specific version of rustfmt. # unstable_features # Default: false # Enables unstable features. Only available on nightly channel # disable_all_formatting # Default: false # Don't reformat anything # skip_children # Default: false # Don't reformat out of line modules # error_on_line_overflow # Default: true # Error if unable to get all lines within max_width # error_on_unformatted # Default: false # Error if unable to get comments or string literals within max_width, or they are left with trailing whitespaces # report_todo = "Always" # [Always|Unnumbered|Never] Default: Never # Report all, none or unnumbered occurrences of TODO in source file comments # report_fixme = "Always" # [Always|Unnumbered|Never] Default: Never # Report all, none or unnumbered occurrences of FIXME in source file comments # verbose # Default: false # Use verbose output # file_lines # Default: FileLines(None)# Lines to format; this is not supported in rustfmt.toml, and can only be specified via the --file-lines option # width_heuristics Default: WidthHeuristics { fn_call_width: 60, struct_lit_width: 18, struct_variant_width: 35, array_width: 60, chain_width: 60, single_line_if_else_max_width: 50 } # 'small' heuristic values