Skip to content

Commit 3328253

Browse files
authored
feat: add rfc process (#881)
1 parent b6bf5f1 commit 3328253

File tree

3 files changed

+184
-1
lines changed

3 files changed

+184
-1
lines changed

crates/q_cli/src/cli/user.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use std::fmt;
22
use std::fmt::Display;
3-
use std::process::ExitCode;
3+
use std::process::{
4+
ExitCode,
5+
exit,
6+
};
47
use std::time::Duration;
58

69
use anstream::println;
@@ -144,6 +147,8 @@ pub enum UserSubcommand {
144147

145148
impl UserSubcommand {
146149
pub async fn execute(self) -> Result<ExitCode> {
150+
ctrlc::set_handler(|| exit(1))?;
151+
147152
match self {
148153
Self::Root(cmd) => cmd.execute().await,
149154
}

rfcs/0000-template.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
- Feature Name: (fill me in with a unique ident, `my_awesome_feature`)
2+
- Start Date: (fill me in with today's date, YYYY-MM-DD)
3+
4+
# Summary
5+
6+
[summary]: #summary
7+
8+
One paragraph explanation of the feature.
9+
10+
# Motivation
11+
12+
[motivation]: #motivation
13+
14+
Why are we doing this? What use cases does it support? What is the expected outcome?
15+
16+
# Guide-level explanation
17+
18+
[guide-level-explanation]: #guide-level-explanation
19+
20+
Explain the proposal as if it was already included in the project and you were teaching it to another maintainer. That generally means:
21+
22+
- Introducing new named concepts.
23+
- Explaining the feature largely in terms of examples.
24+
- Discuss how this impacts the ability to read, understand, and maintain the codebase. Code is read and modified far more often than written; will the proposed feature make code easier to maintain?
25+
26+
# Reference-level explanation
27+
28+
[reference-level-explanation]: #reference-level-explanation
29+
30+
This is the technical portion of the RFC. Explain the design in sufficient detail that:
31+
32+
- Its interaction with other features is clear.
33+
- It is reasonably clear how the feature would be implemented.
34+
- Corner cases are dissected by example.
35+
36+
The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work.
37+
38+
# Drawbacks
39+
40+
[drawbacks]: #drawbacks
41+
42+
Why should we _not_ do this?
43+
44+
# Rationale and alternatives
45+
46+
[rationale-and-alternatives]: #rationale-and-alternatives
47+
48+
- Why is this design the best in the space of possible designs?
49+
- What other designs have been considered and what is the rationale for not choosing them?
50+
- What is the impact of not doing this?
51+
52+
# Unresolved questions
53+
54+
[unresolved-questions]: #unresolved-questions
55+
56+
- What parts of the design do you expect to resolve through the RFC process before this gets merged?
57+
- What parts of the design do you expect to resolve through the implementation of this feature before stabilization?
58+
- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC?
59+
60+
# Future possibilities
61+
62+
[future-possibilities]: #future-possibilities
63+
64+
Think about what the natural extension and evolution of your proposal would
65+
be and how it would affect the language and project as a whole in a holistic
66+
way. Try to use this section as a tool to more fully consider all possible
67+
interactions with the project and language in your proposal.
68+
Also consider how this all fits into the roadmap for the project
69+
and of the relevant sub-team.
70+
71+
This is also a good place to "dump ideas", if they are out of scope for the
72+
RFC you are writing but otherwise related.
73+
74+
If you have tried and cannot think of any future possibilities,
75+
you may simply state that you cannot think of anything.
76+
77+
Note that having something written down in the future-possibilities section
78+
is not a reason to accept the current or a future RFC; such notes should be
79+
in the section on motivation or rationale in this or subsequent RFCs.
80+
The section merely provides additional information.

rfcs/0001-rfc-process.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
- Name: RFC Process
2+
- Start Date: 2025-03-19
3+
4+
# Summary
5+
6+
The "RFC" (request for comments) process is intended to provide a
7+
consistent and controlled path for new features to enter the language
8+
and standard libraries, so that all stakeholders can be confident about
9+
the direction the language is evolving in.
10+
11+
# Motivation
12+
13+
This is a proposal for a more principled RFC process to make it
14+
a more integral part of the overall development process, and one that is
15+
followed consistently to introduce features to QCLI.
16+
17+
# Detailed design
18+
19+
Many changes, including bug fixes and documentation improvements can be
20+
implemented and reviewed via the normal GitHub pull request workflow.
21+
22+
Some changes though are "substantial", and we ask that these be put
23+
through a bit of a design process and produce a consensus among the
24+
community and the maintainers.
25+
26+
## When you need to follow this process
27+
28+
You need to follow this process if you intend to make "substantial"
29+
changes to QCLI. What constitutes a "substantial"
30+
change is evolving based on community norms, but may include the following.
31+
32+
- Adding or removing features, including those that are feature-gated.
33+
- Adding new crates or dependencies
34+
35+
Some changes do not require an RFC:
36+
37+
- Rephrasing, reorganizing, refactoring, or otherwise "changing shape
38+
does not change meaning".
39+
- Additions that strictly improve objective, numerical quality
40+
criteria (warning removal, speedup, better platform coverage, more
41+
parallelism, trap more errors, etc.)
42+
- Additions that are invisible to users of QCLI.
43+
44+
If you submit a pull request to implement a new feature without going
45+
through the RFC process, it may be closed with a polite request to
46+
submit an RFC first.
47+
48+
## What the process is
49+
50+
In short, to get a major feature added to QCLI, one must first get the
51+
RFC merged into the RFC repo as a markdown file. At that point the RFC
52+
is 'active' and may be implemented with the goal of eventual inclusion
53+
into QCLI.
54+
55+
- Fork this repo.
56+
- Copy `rfcs/0000-template.md` to `rfcs/0000-my-feature.md` (where
57+
'my-feature' is descriptive. don't assign an RFC number yet).
58+
- Fill in the RFC
59+
- Submit a pull request. The pull request is the time to get review of
60+
the design from the larger community.
61+
- Build consensus and integrate feedback. RFCs that have broad support
62+
are much more likely to make progress than those that don't receive any
63+
comments.
64+
65+
Eventually, a maintainer will either accept the RFC by
66+
merging the pull request, at which point the RFC is 'active', or
67+
reject it by closing the pull request.
68+
69+
Whomever merges the RFC should do the following:
70+
71+
- Assign an id, using the PR number of the RFC pull request. (If the RFC
72+
has multiple pull requests associated with it, choose one PR number,
73+
preferably the minimal one.)
74+
- Create a corresponding issue in this repo.
75+
- Commit everything.
76+
77+
Once an RFC becomes active then authors may implement it and submit the
78+
feature as a pull request to the repo. An active RFC is not a rubber
79+
stamp, and in particular still does not mean the feature will ultimately
80+
be merged; it does mean that in principle all the major stakeholders
81+
have agreed to the feature and are amenable to merging it.
82+
83+
Modifications to active RFC's can be done in followup PR's. An RFC that
84+
makes it through the entire process to implementation is considered
85+
'complete'; an RFC that fails
86+
after becoming active is 'inactive' and moves to the 'inactive' folder.
87+
88+
# Alternatives
89+
90+
Retain the current informal RFC process. The newly proposed RFC process is
91+
designed to improve over the informal process in the following ways:
92+
93+
- Discourage unactionable or vague RFCs
94+
- Ensure that all serious RFCs are considered equally
95+
- Give confidence to those with a stake in Rust's development that they
96+
understand why new features are being merged
97+
98+
As an alternative, we could adopt an even stricter RFC process than the one proposed here. If desired, we should likely look to Python's [PEP] process for inspiration.

0 commit comments

Comments
 (0)