Skip to content

Commit c56b652

Browse files
Improve README (#417)
* Improve README * Fix wording * Simplify simplify * Fix typo * Restore missing link * Wording * Apply suggestions from code review Co-authored-by: Pete LeVasseur <plevasseur@gmail.com> --------- Co-authored-by: Pete LeVasseur <plevasseur@gmail.com>
1 parent 1c7d6bb commit c56b652

File tree

2 files changed

+68
-228
lines changed

2 files changed

+68
-228
lines changed

CONTRIBUTING.md

Lines changed: 36 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
# Contributing to the coding guidelines
22

3-
> [!NOTE]
4-
> Reviewer or Producer guidance, including bot commands and review deadlines, lives in [REVIEWING.md](REVIEWING.md).
5-
6-
## Table of Contents
7-
8-
- [First-time contributor quick start](#first-time-contributor-quick-start)
9-
- [Contribution workflow](#contribution-workflow)
10-
- [Writing a guideline locally (less typical, not recommended)](#writing-a-guideline-locally-less-typical-not-recommended)
11-
- [Before you begin contributing](#before-you-begin-contributing)
12-
- [Contribution process](#contribution-process)
13-
14-
## First-time contributor quick start
15-
16-
If you are new here, this is the shortest path to a first PR. The detailed workflow is in the next section.
17-
18-
1. (Optional) Discuss the idea on Zulip. See [0) Bring the idea up for discussion](#0-optional-bring-the-idea-up-for-discussion).
19-
2. Open a coding guideline issue. See [1) Submit coding guideline issue](#1-submit-coding-guideline-issue).
20-
3. Wait for the reStructuredText comment from the bot. See [2) Guideline Generated as a Comment](#2-guideline-generated-as-a-comment).
21-
4. Collaborate with a subcommittee member to refine the draft and get `sign-off: create pr`. See [3) Create a Draft with a Member](#3-create-a-draft-with-a-member).
22-
5. Create the PR using the generated RST and include `closes #xyz` in the PR body. See [4) Create the PR](#4-create-the-pr).
23-
6. Iterate on PR feedback until it is approved and merged. See [5) Iterate on Feedback](#5-iterate-on-feedback).
3+
- Looking for the review process? That's in [REVIEWING.md](REVIEWING.md).
4+
- Want to [open an issue](https://github.com/rustfoundation/safety-critical-rust-coding-guidelines/issues)?
5+
- Want to write a Safety Critical Rust Coding guideline? You're in the right place.
246

257
## Contribution Workflow
268

27-
The full workflow is below. Expand the diagram if you want a high-level view.
9+
If you are new here, this is the shortest path to a first PR. Expand the diagram if you want a high-level view.
2810

2911
<details>
3012
<summary>Workflow diagram</summary>
@@ -55,48 +37,36 @@ flowchart TD
5537

5638
</details>
5739

58-
### Note on Chapter Layout
59-
60-
The Safety Critical Rust Coding guidelines has the same chapter layout as the [Ferrocene Language Specification](https://spec.ferrocene.dev/) (FLS). If you would like to contribute a new guideline, find a section from the FLS that interests you, then write a guideline in the corresponding chapter of these coding guidelines.
40+
### 1) (Optional) Bring your idea up for discussion
6141

62-
### 0) (Optional) Bring the idea up for discussion
42+
If you want to discuss the feasibility of a guideline or discuss it with others, drop by the [Safety-Critical Rust Consortium's Zulip stream](https://rust-lang.zulipchat.com/#narrow/channel/445688-safety-critical-consortium) and start a discussion topic.
6343

64-
Have an idea for a coding guideline? Want to discuss it?
65-
66-
If you want to discuss the feasibility of a guideline or discuss it with others to ensure it's not too similar an existing guideline, drop by the [Safety-Critical Rust Consortium's Zulip stream](https://rust-lang.zulipchat.com/#narrow/channel/445688-safety-critical-consortium) and open a new topic.
67-
68-
### 1) Submit coding guideline issue
69-
70-
To add a new coding guideline, open a [coding guideline issue](https://github.com/rustfoundation/safety-critical-rust-coding-guidelines/issues/new?template=CODING-GUIDELINE.yml).
71-
72-
#### 1.1) Finding the FLS ID
73-
74-
<details>
75-
<summary>How to find the FLS paragraph ID</summary>
44+
### 2) Open a new coding guideline issue
7645

77-
Note that the FLS ID should be filled according to the FLS paragraph ID for which the guideline is covering. One way to go about finding this is to inspect the page using your web browser. You'll be looking for something like:
46+
The Safety Critical Rust Coding guidelines has the same chapter layout as the [Ferrocene Language Specification](https://spec.ferrocene.dev/) (FLS). To contribute a new guideline, find the relevant section from the FLS, then write a guideline in the corresponding chapter of the coding guidelines.
7847

48+
1. Before you begin, make sure you agree to the [Licensing clause](#licenses) and [code of conduct](CODE_OF_CONDUCT.md).
7949

80-
```html
81-
<p><span class="spec-paragraph-id" id="fls_4rhjpdu4zfqj">4.1:1</span>
82-
```
50+
2. Find the [FLS paragraph](https://rust-lang.github.io/fls/) which the guideline is covering by inspecting the page in your web browser, and looking for something like:
8351

84-
You would then pull `fls_4rhjpdu4zfqj` to place in the FLS ID field.
52+
```html
53+
<p><span class="spec-paragraph-id" id="fls_4rhjpdu4zfqj">4.1:1</span>
54+
```
8555

86-
</details>
56+
In this example, the FLS ID is `fls_4rhjpdu4zfqj`.
8757

58+
3. Add a new coding guideline, open a [coding guideline issue](https://github.com/rustfoundation/safety-critical-rust-coding-guidelines/issues/new?template=CODING-GUIDELINE.yml). You'll need the FLS ID from the previous step.
8859

89-
### 2) Guideline Generated as a Comment
9060

91-
A GitHub Action will fire, adding a comment to your newly created issue with
61+
A GitHub Action will automatically add a comment to your newly created issue with
9262
the contents of the coding guideline prepared written out correctly
9363
in reStructuredText.
9464

9565
Note that if you later update the body of the coding guideline issue this will
9666
fire the GitHub Action again and update the original comment with the new
9767
contents converted to reStructuredText.
9868

99-
### 3) Create a Draft with a Member
69+
### 3) Improve the draft with a consortium Member
10070

10171
Within 14 days of your submission, a member of the Coding Guidelines Subcommittee should give you a first review. You'll work with them (and other members) to flesh out the concept and ensure the guideline is well prepared for a Pull Request.
10272

@@ -105,125 +75,40 @@ Within 14 days of your submission, a member of the Coding Guidelines Subcommitte
10575

10676
When a subcommittee member adds the `sign-off: create pr` label, the issue review is considered complete and reviewer reminders stop.
10777

108-
### 4) Create the PR
109-
110-
> [!NOTE]
111-
> Here's a list of recommended prerequisites that shall be fulfilled before turning an issue into a PR:
112-
>
113-
> * The new rule isn't already covered by another rule
114-
> * OR, in case there is(are) already another rule(s),
115-
> * The existing rule(s) need(s) to be linked to the new rule,
116-
> * AND the new rule needs to link to the existing rule(s).
117-
> * All sections contain some content
118-
> * Content written may be *incomplete*, but must not be *incorrect*
119-
> * `🧪 Code Example Test Results` section shows all example code compiles
78+
### 4) Create the PR from the draft
12079

121-
As soon as these prerequisites are fulfilled, the draft shall be marked as PR-ready by a subcommittee member, by labeling the issue with `sign-off: create pr`. This denotes that you should create a Pull Request with your Guideline. Further discussion about the amount and correctness of its content shall then be done on the Pull Request itself.
80+
Before turning an issue into a PR, make sure that:
12281

123-
The contents of the PR should be based on the bot comment containing the generated RST form of your guideline, as seen in [Step 2](#2-guideline-generated-as-a-comment). The comment has the exact file content you'll need.
82+
* The new rule isn't already covered by another rule.
83+
* The new rules is linked to any other related rules.
84+
* All sections contain some content.
85+
* All content is correct. Content written may be *incomplete*.
86+
* `🧪 Code Example Test Results` section shows all example code compiles.
12487

125-
In order to ensure your guideline appears when rendering the document, reference the generated comment from [Step 2](#2-guideline-generated-as-a-comment). All the steps necessary should appear below the headings `📁 Target Location` and `🗂️ Update Chapter Index`.
88+
As soon as these prerequisites are fulfilled, a committee member will label the issue as `sign-off: create pr`:
12689

127-
Make sure to include this command in the body of your PR, where `xyz` is the number of the issue you opened in [Step 1](#1-submit-coding-guideline-issue):
128-
129-
> `closes #xyz`
130-
131-
This will ensure issue `#xyz` is closed when your Pull Request gets merged.
90+
1. Create a Pull Request with your Guideline, using the bot comment containing the generated reStructuredText form of your guideline. All the steps necessary to link the new guidelines should appear below the headings `📁 Target Location` and `🗂️ Update Chapter Index` in the bot comment.
91+
2. Make sure to include the line `closes #xyz` where `xyz` is your issue number.
13292

93+
Further discussion about the amount and correctness of its content shall then be done on the Pull Request itself.
13394

13495
### 5) Iterate on Feedback
13596

136-
#### 5.1) Member Begins Review
137-
13897
The generated Pull Request may attract additional feedback or simply be an easier place to suggest targeted edits.
139-
14098
As the contributor of the coding guideline and opener of the issue, you'll respond to comments, discuss, all the normal things on the pull request.
14199

142-
#### 5.2) Update the PR Based on Feedback
143-
144-
If you agree with the suggested changes, you've got two options:
145-
146-
- Iterate directly on the Pull Request, if you're comfortable with reStructuredText to do so
147-
- If you'd rather make revisions in Markdown, you can return to the issue
148-
from [1) Submit coding guideline issue](#1-submit-coding-guideline-issue)
149-
to regenerate the reStructured Text guideline form by following steps
150-
outlined in
151-
[6) Contributor Applies Feedback on Issue](#6-contributor-applies-feedback-on-issue)
152-
and
153-
[7) Contributor Applies Regenerated Guideline to PR](#7-contributor-applies-regenerated-guideline-to-pr)
154-
155-
### 6) Contributor Applies Feedback on Issue
156-
157-
(Optional, if not comfortable with reStructured Text from
158-
[5.2) Update the PR Based on Feedback](#52-update-the-pr-based-on-feedback))
159-
160-
The contributor edits the body of the issue summary, reflecting suggestions and then saves it.
161-
You will then momentarily see a new comment added to the issue containing the updated
162-
guideline content written in reStructured Text.
100+
- If you you're comfortable editing reStructuredText, you can apply feedback directly in the PR.
101+
- If you'd rather make revisions in Markdown, edit the original issue, and and regenerate the reStructuredText that way. You'll have to copy the changes to the PR.
163102

164-
### 7) Contributor Applies Regenerated Guideline to PR
165-
166-
(Optional, if not comfortable with reStructured Text from
167-
[5.2) Update the PR Based on Feedback](#52-update-the-pr-based-on-feedback))
168-
169-
The contributor then copy + pastes the contents of the guideline from
170-
[6) Contributor Applies Feedback on Issue](#6-contributor-applies-feedback-on-issue)
171-
and overwrites the contents of their feature branch, so that the feedback is
172-
reflected into the Pull Request.
173-
174-
### 8) Your Guideline gets merged
175-
176-
Once the coding guideline contents have passed review, a subcommittee member will approve the pull request, and put it on the merge queue to be merged.
177-
178-
### You just contributed a coding guideline!
179-
180-
That's it!
181-
182-
---
183-
184-
## Writing a guideline locally (less typical, not recommended)
185-
186-
We recommend the issue-based workflow above. If you need to work locally, expand the section below.
187-
188-
<details>
189-
<summary>Local authoring steps</summary>
190-
191-
While it is possible to create guidelines locally, we encourage contributors to make use of the process described above since it handles some of the fiddly details for you as a guideline writer.
192-
193-
### Guideline template
194-
195-
We have a script `./generate_guideline_templates.py` which assumes you're using `uv` that can be run to generate the template for a guideline with properly randomized IDs.
196-
197-
You can then copy and paste this guideline from the command line into the correct chapter.
198-
199-
</details>
200-
201-
## Before You Begin Contributing
103+
Once the coding guideline contents have passed review, a subcommittee member with `write` access will approve the pull request, and put it on the merge queue.
202104

203105
### Licenses
204106

205-
There is no Contributor License Agreement to sign to contribute this project.
206-
Your contribution will be covered by the license(s) granted for this
207-
repository, commonly MIT, Apache, and/or CC-BY, but could be a different
208-
license. In other words, your contribution will be licensed to the Foundation
209-
and all downstream users under those licenses. You can read more in the
107+
There is no Contributor License Agreement to sign to contribute this project.
108+
Your contribution will be covered by the license(s) granted for this
109+
repository, commonly MIT, Apache, and/or CC-BY, but could be a different
110+
license. In other words, your contribution will be licensed to the Foundation
111+
and all downstream users under those licenses. You can read more in the
210112
Foundation's [intellectual property policy][ip-policy].
211113

212-
### Code of Conduct
213-
214-
Please review and adhere to the [code of conduct](CODE_OF_CONDUCT.md) before
215-
contributing any pull requests.
216-
217-
## Contribution Process
218-
219-
All submissions, including submissions by project members, require review. We
220-
use GitHub pull requests for this purpose. Consult [GitHub Help][pull-requests]
221-
for more information on using pull requests.
222-
223-
### Issues
224-
225-
Do you just want to file an issue for the project? Please do so in GitHub under
226-
the `Issues` tab.
227-
228114
[ip-policy]: https://foundation.rust-lang.org/policies/intellectual-property-policy/
229-
[pull-requests]: https://help.github.com/articles/about-pull-requests/

0 commit comments

Comments
 (0)