This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[WIP] Styling with rustfmt #286
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# SEE https://github.com/rust-lang-nursery/rustfmt/blob/master/Configurations.md | ||
# activate unstable features, so we can configure a few of them | ||
unstable_features = true | ||
|
||
|
||
# everything without a comment is at the default value, but we could | ||
# also always pin the rustfmt version with the following line | ||
# (at the time of writing): | ||
# | ||
# required_version = "0.8.2" | ||
# | ||
|
||
indent_style = "Block" | ||
use_small_heuristics = "Default" | ||
binop_separator = "Front" | ||
combine_control_expr = true | ||
comment_width = 100 | ||
condense_wildcard_suffixes = false | ||
control_brace_style = "AlwaysSameLine" | ||
disable_all_formatting = false | ||
error_on_line_overflow = false | ||
error_on_unformatted = false | ||
fn_args_density = "Tall" | ||
brace_style = "SameLineWhere" | ||
empty_item_single_line = true | ||
fn_single_line = false | ||
where_single_line = false | ||
force_explicit_abi = true | ||
format_strings = false | ||
# use tabs not spaces | ||
hard_tabs = true | ||
imports_indent = "Block" | ||
imports_layout = "Mixed" | ||
# do keep imports as they were written | ||
merge_imports = false | ||
# put a trailing comma in match block | ||
match_block_trailing_comma = true | ||
max_width = 100 | ||
merge_derives = true | ||
force_multiline_blocks = false | ||
newline_style = "Unix" | ||
normalize_comments = false | ||
remove_nested_parens = true | ||
reorder_imports = true | ||
# our module order is intentional | ||
reorder_modules = false | ||
reorder_impl_items = false | ||
report_todo = "Never" | ||
report_fixme = "Never" | ||
skip_children = false | ||
space_after_colon = true | ||
space_before_colon = false | ||
struct_field_align_threshold = 0 | ||
spaces_around_ranges = false | ||
struct_lit_single_line = true | ||
tab_spaces = 4 | ||
trailing_comma = "Vertical" | ||
# do not leave unneeded semicolons around | ||
trailing_semicolon = false | ||
type_punctuation_density = "Wide" | ||
# we use field shorthands | ||
use_field_init_shorthand = true | ||
# we prefer `?` over `try!` | ||
use_try_shorthand = true | ||
# we prefer to have a block over long lines | ||
# even in comments :D | ||
wrap_comments = true | ||
# do not create unnaccesary arm blocks | ||
match_arm_blocks = false | ||
blank_lines_upper_bound = 1 | ||
blank_lines_lower_bound = 0 | ||
hide_parse_errors = false | ||
color = "Auto" | ||
# license_template_path = "" | ||
ignore = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,5 @@ error_chain! { | |
} | ||
links { | ||
Client(client::error::Error, client::error::ErrorKind) #[doc="Client error"]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is only possible to configure rustfmt (at the moment) to either have importans in the first line and then match up the second line to it (
imports_indent = "Visual"
) or make one-tabbed blocks like this (imports_indent = "Block"
)