From 84a61881f5a3be9435d237d055645ef8b9a0be29 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 22 Sep 2022 15:32:51 +0100 Subject: [PATCH 1/5] Add blog post for the Rust Style Team --- ...22-09-22-announcing-the-rust-style-team.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md diff --git a/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md b/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md new file mode 100644 index 000000000..84c94ee55 --- /dev/null +++ b/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md @@ -0,0 +1,61 @@ +--- +layout: post +title: "Announcing the Rust Style Team" +author: Josh Triplett +team: The Rust Style Team +--- + +Rust has a standardized style, and an implementation of that style in the +`rustfmt` tool. The standardized style helps Rust developers feel comfortable +and at home in many different projects, and the tooling support from `rustfmt` +makes it easy to maintain and to incorporate in continuous integration. +`rustfmt` also provides many options to customize the style, but the style +guide defines the defaults, and most projects use those defaults. + +The standard Rust style resulted from development and discussion within the +Rust style team, between 2016 and 2018. After publishing the style guide, the +Rust style team wound up its active work, by design. + +However, as the Rust language develops, we have a regular need for improvements +to the style guide, such as to support new language constructs. This includes +minor language changes, as well as highly anticipated new features such as +`let`-chaining (RFC 2497) and `let`-`else` (RFC 3137). New constructs like +these, by default, get ignored and not formatted by rustfmt, and subsequently +need formatting added. Some of this work has fallen to the rustfmt team in +recent years, but the rustfmt team would prefer to implement style +determinations made by another team rather than making such determinations +itself. + +In addition, rustfmt maintains backwards compatibility guarantees: code that +has been correctly formatted with rustfmt won't get formatted differently with +a future version of rustfmt. This avoids churn, and avoids creating CI failures +when people use rustfmt to check style in CI. However, this also prevents +evolving the Rust style to take community desires into account and improve +formatting over time. rustfmt provides various configuration options to change +its default formatting, and many of those options represent changes that many +people in the community would like enabled by default. + +For instance, many people prefer to format their `use` lines in three blocks: +imports from the standard library, imports from external crates, and then +imports from modules within the same project. `rustfmt` supports this via the +option `group_imports = StdExternalCrate`, but cannot make this the default +without causing CI failures in existing projects. + +To solve both of these problems, [RFC +3309](https://rust-lang.github.io/rfcs/3309-style-team.html) has revived the +Rust style team, with three goals: + +- Making determinations about styling for new Rust constructs +- Evolving the existing Rust style +- Defining mechanisms to evolve the Rust style while taking backwards + compatibility into account, such as via Rust editions or similar mechanisms + +We don't plan to make any earth-shattering style changes; the look and feel of +Rust will remain largely the same. Evolutions to the default Rust style will +largely consist of established `rustfmt` options people already widely enable, +or would enable if they were stable. + +We expect that the initial work of the style team will focus on clearing a +backlog of new language constructs that lack formatting guidance. Afterwards, +we look forward to introducing a few minor style evolutions in the Rust 2024 +edition. From 8949efad9d59d7987b6f2d4073b37871c0d64923 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 24 Sep 2022 11:33:11 +0100 Subject: [PATCH 2/5] Start talking about style evolution earlier in the post --- .../inside-rust/2022-09-22-announcing-the-rust-style-team.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md b/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md index 84c94ee55..459a75467 100644 --- a/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md +++ b/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md @@ -39,7 +39,10 @@ For instance, many people prefer to format their `use` lines in three blocks: imports from the standard library, imports from external crates, and then imports from modules within the same project. `rustfmt` supports this via the option `group_imports = StdExternalCrate`, but cannot make this the default -without causing CI failures in existing projects. +without causing CI failures in existing projects. We need a way to evolve the +default Rust style compatibly, similar in spirit to the mechanisms we use for +Rust editions: allowing existing style to continue working, and allowing people +to opt into new style. To solve both of these problems, [RFC 3309](https://rust-lang.github.io/rfcs/3309-style-team.html) has revived the From f478c785ba88615bdbf6091188a8ce004ede5339 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 24 Sep 2022 11:34:48 +0100 Subject: [PATCH 3/5] Broaden and soften descriptions of possible approaches to style evolution Co-authored-by: Caleb Cartwright --- .../2022-09-22-announcing-the-rust-style-team.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md b/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md index 459a75467..d761b9549 100644 --- a/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md +++ b/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md @@ -51,7 +51,7 @@ Rust style team, with three goals: - Making determinations about styling for new Rust constructs - Evolving the existing Rust style - Defining mechanisms to evolve the Rust style while taking backwards - compatibility into account, such as via Rust editions or similar mechanisms + compatibility into account We don't plan to make any earth-shattering style changes; the look and feel of Rust will remain largely the same. Evolutions to the default Rust style will @@ -60,5 +60,5 @@ or would enable if they were stable. We expect that the initial work of the style team will focus on clearing a backlog of new language constructs that lack formatting guidance. Afterwards, -we look forward to introducing a few minor style evolutions in the Rust 2024 -edition. +we will look towards defining and implementing the mechanisms to evolve the +default Rust style, and then begin introducing style improvements. From f344ea0321fd7d269e8ab3fdbba5d36b3f7d7fa4 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 24 Sep 2022 17:37:15 +0100 Subject: [PATCH 4/5] Update post date to today --- ...style-team.md => 2022-09-29-announcing-the-rust-style-team.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename posts/inside-rust/{2022-09-22-announcing-the-rust-style-team.md => 2022-09-29-announcing-the-rust-style-team.md} (100%) diff --git a/posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md b/posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md similarity index 100% rename from posts/inside-rust/2022-09-22-announcing-the-rust-style-team.md rename to posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md From cdb0745e3a18ed9b0633905137e1e7518b48e501 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 29 Sep 2022 01:08:22 +0100 Subject: [PATCH 5/5] Use less idiomatic language --- posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md b/posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md index d761b9549..25acdd506 100644 --- a/posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md +++ b/posts/inside-rust/2022-09-29-announcing-the-rust-style-team.md @@ -14,7 +14,7 @@ guide defines the defaults, and most projects use those defaults. The standard Rust style resulted from development and discussion within the Rust style team, between 2016 and 2018. After publishing the style guide, the -Rust style team wound up its active work, by design. +Rust style team concluded its active work, by design. However, as the Rust language develops, we have a regular need for improvements to the style guide, such as to support new language constructs. This includes