diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000000..0be5c8f05d --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,26 @@ +# This file defines the Rust style for automatic reformatting. +# See also https://rust-lang.github.io/rustfmt + +# Rust language edition to be used by the parser. +edition = "2021" + +# Version of the formatting rules to use. +style_edition = "2021" + +# Line endings will be converted to \n. +newline_style = "Unix" + +wrap_comments = true + +# The "Default" setting has a heuristic which splits lines too aggresively. +# We are willing to revisit this setting in future versions of rustfmt. +# Bugs: +# * https://github.com/rust-lang/rustfmt/issues/3119 +# * https://github.com/rust-lang/rustfmt/issues/3120 +use_small_heuristics = "Max" + +# Third party code is formatted upstream. +ignore = [ + "third_party/rust/**/crate", + "third_party/rust/chromium_crates_io/vendor", +] diff --git a/OWNERS_INFRA b/OWNERS_INFRA index eb3bb3ef92..c7d672b8ee 100644 --- a/OWNERS_INFRA +++ b/OWNERS_INFRA @@ -10,6 +10,7 @@ per-file .vpython3=mbonadei@webrtc.org,jansson@webrtc.org,jleconte@webrtc.org per-file AUTHORS=* per-file DEPS=* per-file pylintrc=mbonadei@webrtc.org,jansson@webrtc.org,jleconte@webrtc.org +per-file .rustfmt.toml=boivie@webrtc.org,mbonadei@webrtc.org,jleconte@webrtc.org per-file pylintrc_old_style=mbonadei@webrtc.org,jansson@webrtc.org,jleconte@webrtc.org per-file WATCHLISTS=* per-file native-api.md=mbonadei@webrtc.org