Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Style checking our libs with rustfmt #289

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions rfcs/0207-rustfmt-our-libs.md
Original file line number Diff line number Diff line change
@@ -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?