Skip to content

Commit 33bd3f9

Browse files
quark-zjufacebook-github-bot
authored andcommitted
rustfmt: set imports_granularity to Item to minimize conflicts
Summary: To make the codebase a bit more consistent and reduce conflicts. Similar to Java. Note: The fbsource Rust lint does not respect this file so it cannot conflict with the fbcode rustfmt config. That means a more preserving (for what to group in `{}` and what not), less controversial (when to use `{}` grouping is controversial) choice `imports_layout = "HorizontalVertical"` (like [black](https://github.com/psf/black) in Python) cannot be used at present. See also: - rust-lang/rustfmt#3361 - rust-lang/rustfmt#3362 - https://fb.workplace.com/groups/rust.language/posts/6720351014680123/ - https://fb.workplace.com/groups/rust.language/posts/5429720200409884/ This adds the config without changing the files. Reviewed By: yancouto Differential Revision: D31746731 fbshipit-source-id: 8e171829fd53691a59bf3b80cdc500c0b3993ba5
1 parent d93fb54 commit 33bd3f9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

eden/scm/.rustfmt.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Inherit from fbcode root
2+
edition = "2018"
3+
merge_derives = false
4+
use_field_init_shorthand = true
5+
6+
# Project specific config.
7+
# Note: fbcode rustfmt does not respect these configs! So they cannot conflict
8+
# with fbcode format options (i.e. run fbcode rustfmt and the result isn't
9+
# changing).
10+
11+
# To minimize conflicts, and make things easier to grep.
12+
imports_granularity = "Item"

0 commit comments

Comments
 (0)