-
Notifications
You must be signed in to change notification settings - Fork 4
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
Better rustfmt #51
Better rustfmt #51
Changes from all commits
3dbab4d
1fd0c64
442e0ee
0cdaa5a
494faba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,68 @@ | ||
max_width = 90 # changed | ||
hard_tabs = false | ||
tab_spaces = 4 | ||
newline_style = "Auto" | ||
use_small_heuristics = "Default" | ||
indent_style = "Block" | ||
wrap_comments = false | ||
format_code_in_doc_comments = false | ||
comment_width = 80 | ||
normalize_comments = true # changed | ||
normalize_doc_attributes = false | ||
# license_template_path = "LICENSE_TEMPLATE" # changed | ||
format_strings = false | ||
format_macro_matchers = false | ||
format_macro_bodies = true | ||
# `rustfmt` internal settings | ||
# | ||
# emit_mode = "Files" | ||
# make_backup = false | ||
|
||
binop_separator = "Front" | ||
blank_lines_lower_bound = 0 | ||
blank_lines_upper_bound = 1 | ||
brace_style = "SameLineWhere" | ||
color = "Auto" | ||
combine_control_expr = false # better all around in our opinions | ||
comment_width = 80 # changed | ||
condense_wildcard_suffixes = true # changed | ||
control_brace_style = "AlwaysSameLine" | ||
disable_all_formatting = false | ||
edition = "2018" # changed | ||
empty_item_single_line = true | ||
struct_lit_single_line = true | ||
enum_discrim_align_threshold = 0 | ||
error_on_line_overflow = true # be more strict | ||
error_on_unformatted = true # be more strict | ||
fn_args_layout = "Tall" | ||
fn_single_line = false | ||
where_single_line = false | ||
force_explicit_abi = true | ||
force_multiline_blocks = true # changed | ||
format_code_in_doc_comments = true # changed | ||
format_macro_bodies = true # changed | ||
format_macro_matchers = true # changed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This caused problems in the past. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have unchanged them all. |
||
format_strings = true # changed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not a good default to have. Why would you want that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't had any bad experiences with those settings, except for changing the |
||
hard_tabs = false | ||
hide_parse_errors = false | ||
ignore = [] | ||
imports_indent = "Block" | ||
imports_layout = "Vertical" # changed | ||
imports_layout = "Vertical" # makes editing quicker | ||
inline_attribute_width = 0 # unchanged, for ease of editing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option is unstable and since we only set it to its default pls remove. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
# license_template_path = "LICENSE_TEMPLATE" # changed | ||
match_arm_blocks = true | ||
match_block_trailing_comma = false | ||
max_width = 90 # changed | ||
merge_derives = true | ||
merge_imports = true # changed | ||
newline_style = "Unix" # changed, prevents `\r\n` being accidentally introduced | ||
normalize_comments = true # no /* */ comments should be in master | ||
normalize_doc_attributes = true # changed | ||
overflow_delimited_expr = false | ||
remove_nested_parens = true | ||
reorder_impl_items = true # changed | ||
reorder_imports = true | ||
reorder_modules = true | ||
reorder_impl_items = false | ||
type_punctuation_density = "Wide" | ||
space_before_colon = false | ||
report_fixme = "Always" # changed | ||
report_todo = "Always" # changed | ||
# required_version = "CARGO_PKG_VERSION" | ||
skip_children = false | ||
space_after_colon = true | ||
space_before_colon = false | ||
spaces_around_ranges = false | ||
binop_separator = "Front" | ||
remove_nested_parens = true | ||
combine_control_expr = false # changed | ||
overflow_delimited_expr = false | ||
struct_field_align_threshold = 0 | ||
enum_discrim_align_threshold = 0 | ||
match_arm_blocks = true | ||
force_multiline_blocks = true # changed | ||
fn_args_layout = "Tall" | ||
brace_style = "SameLineWhere" | ||
control_brace_style = "AlwaysSameLine" | ||
trailing_semicolon = false # changed | ||
struct_lit_single_line = true | ||
tab_spaces = 4 | ||
trailing_comma = "Vertical" | ||
match_block_trailing_comma = false | ||
blank_lines_upper_bound = 1 | ||
blank_lines_lower_bound = 0 | ||
edition = "2018" # changed | ||
version = "One" | ||
merge_derives = true | ||
use_try_shorthand = true # changed | ||
use_field_init_shorthand = true # changed | ||
force_explicit_abi = true | ||
condense_wildcard_suffixes = false | ||
color = "Auto" | ||
trailing_semicolon = false # changed | ||
type_punctuation_density = "Wide" | ||
unstable_features = true # changed | ||
disable_all_formatting = false | ||
skip_children = false | ||
hide_parse_errors = false | ||
error_on_line_overflow = false | ||
error_on_unformatted = false | ||
report_todo = "Always" | ||
report_fixme = "Always" | ||
ignore = [] | ||
|
||
# Below are `rustfmt` internal settings | ||
# | ||
# emit_mode = "Files" | ||
# make_backup = false | ||
use_field_init_shorthand = true # changed | ||
use_small_heuristics = "Default" | ||
use_try_shorthand = true # changed | ||
version = "Two" # changed | ||
where_single_line = false # unchanged, for ease of editing | ||
wrap_comments = true # fits comments to the line |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reeeeeally not sure if I want our CI to fail because of a bug in rustfmt ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a bug I encountered (rust-lang/rustfmt#3805), but it was easily fixable by changing the signature width.