From 66da09f4708dd25e3b2f73a8ce0f6dc34c03acd9 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Tue, 8 Jan 2019 21:38:10 +0100 Subject: [PATCH 1/2] Added RFC for style checking with rustfmt --- rfcs/0207-rustfmt-our-libs.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 rfcs/0207-rustfmt-our-libs.md diff --git a/rfcs/0207-rustfmt-our-libs.md b/rfcs/0207-rustfmt-our-libs.md new file mode 100644 index 00000000..9bd6c9c4 --- /dev/null +++ b/rfcs/0207-rustfmt-our-libs.md @@ -0,0 +1,34 @@ +# Summary +[summary]: #summary + +This RFC proposes to use CI to give errors, or bors to apply rustfmt on merge to +make sure our lib do not diverge in style within the WG's libraries. Moreover, +it can act as a reference for newcomers to also follow the same style. + +# Motivation +[motivation]: #motivation + +The main motivation is to keep the WG's style consistent. As libraries continue +to evolve over time, as will the style if we do not have a system to keep us in +check. It could also be used as an example to motivate the newcomers of embedded +Rust to use `rustfmt` and keep the style consistent. It helps everyone when +opening someones code and feeling at home, and not needing to reread the code to +understand the style of the writer, which is a common issue in for example C++. + +# Detailed design +[design]: #detailed-design + +All in all, two main methods were discussed: + +1. Enforce `rustfmt` at CI level, and have an extra target for formating which +will fail if the code is not following the correct style. This does however mean +that there can be a lot of commit noise to just "fix CI style errors". + +2. Have bors apply rustfmt on merge. This would be the painless method, but +would not act as an example for newcomers. + +# Unresolved Questions +[unresolved]: #unresolved + +* Should we do it? +* If so, which method to use? From c1aac1808eac385a0b00933ea992cb3db45f6a56 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Tue, 8 Jan 2019 22:05:57 +0100 Subject: [PATCH 2/2] Correct RFC number --- rfcs/{0207-rustfmt-our-libs.md => 0289-rustfmt-our-libs.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename rfcs/{0207-rustfmt-our-libs.md => 0289-rustfmt-our-libs.md} (100%) diff --git a/rfcs/0207-rustfmt-our-libs.md b/rfcs/0289-rustfmt-our-libs.md similarity index 100% rename from rfcs/0207-rustfmt-our-libs.md rename to rfcs/0289-rustfmt-our-libs.md