From ec041c1bed36fb9b738e627cb6a6df2ab2b5164b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 31 Aug 2022 00:53:54 +0200 Subject: [PATCH 1/6] Rust Style Team --- text/0000-style-team.md | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 text/0000-style-team.md diff --git a/text/0000-style-team.md b/text/0000-style-team.md new file mode 100644 index 000000000..1c95ee473 --- /dev/null +++ b/text/0000-style-team.md @@ -0,0 +1,71 @@ +- Feature Name: N/A +- Start Date: 2022-08-25 +- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000) +- Rust Issue: N/A + +# Summary +[summary]: #summary + +This RFC charters the Rust Style Team, responsible for evolving the Rust style over time. This includes styling for new Rust constructs, as well as the evolution of the existing style over the course of Rust editions (without breaking backwards compatibility). + +# Motivation +[motivation]: #motivation + +RFC 1607 proposed and motivated a process for determining code formatting guidelines and producing a style guide, via a temporary style team. That style guide was published as RFC 2436, and the style team wound up its operation and no longer exists. However, Rust has multiple ongoing needs for new determinations regarding Rust style, such as determining the style of new Rust constructs, and evolving the Rust style over time. Thus, this RFC re-charters the Rust Style Team as a non-temporary subteam. + +# Explanation and charter +[explanation]: #explanation + +The renewed need for the Rust style team began to arise in discussions of language constructs 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. The rustfmt team has expressed a preference to not make style determinations itself; the rustfmt team would prefer to implement style determinations made by another team. + +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. + +This RFC proposes re-chartering the style team, as originally specified in RFC 1607, to determine the Rust style. This includes: +- 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 + +## Team structure and membership + +The Rust style team will be a subteam of both the rustfmt team and the Rust language team. (For the purposes of structures that currently require a team to have only one parent team, such as the `rust-lang/team` repository, the Rust style team will have the rustfmt team as its parent team.) + +The initial members of the style team shall be: +- Lead: Caleb Cartwright (@calebcartwright) +- Jane Losare-Lusby (@yaahc) +- Josh Triplett (@joshtriplett) +- Michael Goulet (@compiler-errors) + +The Rust style team shall have at least 3 members and at most 8. If the team has fewer than 3 members it shall seek new members as its primary focus. + +Members of the style team are nominated by existing members. All existing members of the team must affirmatively agree to the addition of a member, with zero objections; if there is any objection to a nomination, the new member will not be not added. In addition, the team lead or another team member will check with the moderation team regarding any person nominated for membership, to provide an avenue for awareness of concerns or red flags. + +The style team will have regular synchronous meetings when it has work to do. (The style team may also choose to handle individual agenda items asynchronously.) The style team shall not meet when it does not have work to do, but it shall remain in existence. + +The style team will use labels such as `T-style` and `I-style-nominated` on rust-lang repositories, to identify and handle issues requiring style decisions. + +The output of the Rust style team shall be modifications to the Rust style guide, and other guidance to the rustfmt team. The style team shall also make determinations regarding changes to the existing style, typically in the form of proposed changes to rustfmt options; such changes shall be applied in new Rust editions or via similar mechanisms, to avoid generating churn and CI failures in existing Rust code. + +Note that the Rust style guide will generally match the latest version of the Rust style; the style team does not plan to maintain multiple branches of the style guide for different editions, in part because formatting for new constructs will apply to any edition supporting those constructs. + +This RFC proposes to move the Rust style guide to the rust-lang/rust repository, rather than its current location in the RFCs repository. Style work may additionally take place in the `fmt-rfcs` repository (which this RFC proposes to revive). Larger style proposals may wish to start there rather than as PRs to the style guide. The style team may choose to change this process. + +The style team is empowered to make decisions on Rust style directly. However, the rustfmt team may reject or defer style determinations on the basis of implementation feasibility, providing such feedback to the style team for further revision. The style team may also make non-binding recommendations to the rustfmt team on variations that may warrant rustfmt configuration options, but determination of rustfmt configurability remains the purview of the rustfmt team. The style team may also provide non-binding advice to the language team on aspects of proposed Rust language constructs as they affect Rust style and readability. The style team will take input from the Rust community, though it is not bound to follow determinations of community popularity/majority. The style team may also seek professional advice regarding language readability and learnability. + +Style determinations are specifically limited to formatting style guidelines which can be enforced by Rustfmt with its current architecture. Styles that cannot be enforced by Rustfmt without a large amount of work are out of scope. + +Whenever possible, style decisions should be made before a new construct is stabilized. However, style decisions shall not be considered a blocker for stabilization. + +The Rust style team shall make decisions by consensus, as with other Rust teams. Recognizing that matters of style are *particularly* prone to [bikeshed-painting](https://4682b4.bikeshed.com/) almost by definition, the Rust style team may need to make particular effort to reach amicable consensus. + +By way of common understanding, the style team acknowledges that the default style will not and is not expected to satisfy everyone (though it should attempt to take community preferences into account), and that having a single default style is more important than the precise details of that style. The style team may also take into account many other sources of input, including Rust community practice, practice and constructs from other languages, experience with common readings or misreadings of other languages, and research into language learnability and *transfer*. + +# Rationale and alternatives +[rationale-and-alternatives]: #rationale-and-alternatives + +- The rustfmt team could directly determine the Rust style. However, the rustfmt team does not wish to do so; they would prefer to implement styling but not determine the defaults. +- The Rust language team could determine the styling for new language constructs. This would add more complexity and potential [bikeshed-painting](https://b0c4de.bikeshed.com/) to the language design process, and not all members of the language team are interested in that work. This would also not address the need for evolving the existing style, which would be even further outside the desired scope of the language team. + +# Prior art +[prior-art]: #prior-art + +RFC 1607 already defined the style team; this RFC removes the time bound on its mandate, and expands it to cover style evolution. From e7245ef90d55f462c6ba81b69d027003a7e7bd35 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 2 Sep 2022 03:51:52 +0200 Subject: [PATCH 2/6] Link the fmt-rfcs repository Co-authored-by: Caleb Cartwright --- text/0000-style-team.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-style-team.md b/text/0000-style-team.md index 1c95ee473..16a1aa57d 100644 --- a/text/0000-style-team.md +++ b/text/0000-style-team.md @@ -47,7 +47,7 @@ The output of the Rust style team shall be modifications to the Rust style guide Note that the Rust style guide will generally match the latest version of the Rust style; the style team does not plan to maintain multiple branches of the style guide for different editions, in part because formatting for new constructs will apply to any edition supporting those constructs. -This RFC proposes to move the Rust style guide to the rust-lang/rust repository, rather than its current location in the RFCs repository. Style work may additionally take place in the `fmt-rfcs` repository (which this RFC proposes to revive). Larger style proposals may wish to start there rather than as PRs to the style guide. The style team may choose to change this process. +This RFC proposes to move the Rust style guide to the rust-lang/rust repository, rather than its current location in the RFCs repository. Style work may additionally take place in the `fmt-rfcs` [repository](https://github.com/rust-dev-tools/fmt-rfcs) (which this RFC proposes to revive). Larger style proposals may wish to start there rather than as PRs to the style guide. The style team may choose to change this process. The style team is empowered to make decisions on Rust style directly. However, the rustfmt team may reject or defer style determinations on the basis of implementation feasibility, providing such feedback to the style team for further revision. The style team may also make non-binding recommendations to the rustfmt team on variations that may warrant rustfmt configuration options, but determination of rustfmt configurability remains the purview of the rustfmt team. The style team may also provide non-binding advice to the language team on aspects of proposed Rust language constructs as they affect Rust style and readability. The style team will take input from the Rust community, though it is not bound to follow determinations of community popularity/majority. The style team may also seek professional advice regarding language readability and learnability. From 8ea970d4ca023e60175bd950e2698b562cae58d0 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 2 Sep 2022 03:52:25 +0200 Subject: [PATCH 3/6] Note about rustfmt team capacity Co-authored-by: Caleb Cartwright --- text/0000-style-team.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-style-team.md b/text/0000-style-team.md index 16a1aa57d..1bbfd5f8d 100644 --- a/text/0000-style-team.md +++ b/text/0000-style-team.md @@ -62,7 +62,7 @@ By way of common understanding, the style team acknowledges that the default sty # Rationale and alternatives [rationale-and-alternatives]: #rationale-and-alternatives -- The rustfmt team could directly determine the Rust style. However, the rustfmt team does not wish to do so; they would prefer to implement styling but not determine the defaults. +- The rustfmt team could directly determine the Rust style. However, the rustfmt team does not wish to do so, and wouldn't have the capacity even if they did; they would prefer to implement styling but not determine the defaults. - The Rust language team could determine the styling for new language constructs. This would add more complexity and potential [bikeshed-painting](https://b0c4de.bikeshed.com/) to the language design process, and not all members of the language team are interested in that work. This would also not address the need for evolving the existing style, which would be even further outside the desired scope of the language team. # Prior art From b1281e12e8738d912f4d2476b9f266f19aeaec11 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 3 Sep 2022 12:46:37 +0200 Subject: [PATCH 4/6] Fix duplicated word Co-authored-by: Yacin Tmimi --- text/0000-style-team.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-style-team.md b/text/0000-style-team.md index 1bbfd5f8d..da7919606 100644 --- a/text/0000-style-team.md +++ b/text/0000-style-team.md @@ -37,7 +37,7 @@ The initial members of the style team shall be: The Rust style team shall have at least 3 members and at most 8. If the team has fewer than 3 members it shall seek new members as its primary focus. -Members of the style team are nominated by existing members. All existing members of the team must affirmatively agree to the addition of a member, with zero objections; if there is any objection to a nomination, the new member will not be not added. In addition, the team lead or another team member will check with the moderation team regarding any person nominated for membership, to provide an avenue for awareness of concerns or red flags. +Members of the style team are nominated by existing members. All existing members of the team must affirmatively agree to the addition of a member, with zero objections; if there is any objection to a nomination, the new member will not be added. In addition, the team lead or another team member will check with the moderation team regarding any person nominated for membership, to provide an avenue for awareness of concerns or red flags. The style team will have regular synchronous meetings when it has work to do. (The style team may also choose to handle individual agenda items asynchronously.) The style team shall not meet when it does not have work to do, but it shall remain in existence. From fc01d93c54e2e50a6994b26cd044c7ccb8083159 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 3 Sep 2022 12:53:13 +0200 Subject: [PATCH 5/6] Make the style team have one parent team In response to feedback. --- text/0000-style-team.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0000-style-team.md b/text/0000-style-team.md index da7919606..774fae59d 100644 --- a/text/0000-style-team.md +++ b/text/0000-style-team.md @@ -27,7 +27,7 @@ This RFC proposes re-chartering the style team, as originally specified in RFC 1 ## Team structure and membership -The Rust style team will be a subteam of both the rustfmt team and the Rust language team. (For the purposes of structures that currently require a team to have only one parent team, such as the `rust-lang/team` repository, the Rust style team will have the rustfmt team as its parent team.) +The Rust style team will be a subteam of the Rust language team. In addition, the style team will maintain a close working relationship with the rustfmt team. The initial members of the style team shall be: - Lead: Caleb Cartwright (@calebcartwright) @@ -64,6 +64,7 @@ By way of common understanding, the style team acknowledges that the default sty - The rustfmt team could directly determine the Rust style. However, the rustfmt team does not wish to do so, and wouldn't have the capacity even if they did; they would prefer to implement styling but not determine the defaults. - The Rust language team could determine the styling for new language constructs. This would add more complexity and potential [bikeshed-painting](https://b0c4de.bikeshed.com/) to the language design process, and not all members of the language team are interested in that work. This would also not address the need for evolving the existing style, which would be even further outside the desired scope of the language team. +- The style team could become a joint subteam of both the language team and the rustfmt team. However, several people have expressed a preference for this team to have a single parent team, and in response, the rustfmt team has recommended that this be a lang subteam. # Prior art [prior-art]: #prior-art From 50e34d2b5055b40dd743af278081a4dae7cbb941 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 22 Sep 2022 14:04:33 +0100 Subject: [PATCH 6/6] RFC 3309 charters the Rust Style Team --- text/{0000-style-team.md => 3309-style-team.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename text/{0000-style-team.md => 3309-style-team.md} (99%) diff --git a/text/0000-style-team.md b/text/3309-style-team.md similarity index 99% rename from text/0000-style-team.md rename to text/3309-style-team.md index 774fae59d..d50ad5f6f 100644 --- a/text/0000-style-team.md +++ b/text/3309-style-team.md @@ -1,6 +1,6 @@ - Feature Name: N/A - Start Date: 2022-08-25 -- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000) +- RFC PR: [rust-lang/rfcs#3309](https://github.com/rust-lang/rfcs/pull/3309) - Rust Issue: N/A # Summary