Skip to content

Commit fcf3f02

Browse files
committed
Contributing: improving language and style
1 parent 9ea04a6 commit fcf3f02

File tree

1 file changed

+26
-30
lines changed

1 file changed

+26
-30
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,18 @@ To contribute a patch, the workflow is a as follows:
7777
2. Create topic branch
7878
3. Commit patches
7979

80-
In general commits should be atomic and diffs should be easy to read. For this
81-
reason do not mix any formatting fixes or code moves with actual code changes.
80+
Please keep commits should atomic and diffs easy to read. For this reason
81+
do not mix any formatting fixes or code moves with actual code changes.
8282
Further, each commit, individually, should compile and pass tests, in order to
8383
ensure git bisect and other automated tools function properly.
8484

85-
When adding a new feature thought must be given to the long term technical debt.
86-
Every new features should be covered by unit tests.
85+
Please cover every new feature with unit tests.
8786

8887
When refactoring, structure your PR to make it easy to review and don't hesitate
8988
to split it into multiple small, focused PRs.
9089

9190
Commits should cover both the issue fixed and the solution's rationale.
92-
These [guidelines](https://chris.beams.io/posts/git-commit/) should be kept in
93-
mind.
91+
Please keep these [guidelines](https://chris.beams.io/posts/git-commit/) in mind.
9492

9593
To facilitate communication with other contributors, the project is making use
9694
of GitHub's "assignee" field. First check that no one is assigned and then
@@ -104,12 +102,11 @@ The main library development happens in the `master` branch. This branch must
104102
always compile without errors (using GitHub CI). All external contributions are
105103
made within PRs into this branch.
106104

107-
Prerequisites that a PR must satisfy in order to be considered for merging into
108-
the `master` branch:
105+
Prerequisites that a PR must satisfy for merging into the `master` branch:
109106
* each commit within a PR must compile and pass unit tests with no errors, with
110107
every feature combination (including compiling the fuzztests) on some
111108
reasonably recent compiler (this is partially automated with CI, so the rule
112-
is that if GitHub CI is not passing, the commit can't be accepted);
109+
is that we will not accept commits which do not pass GitHub CI);
113110
* the tip of any PR branch must also compile and pass tests with no errors on
114111
MSRV (check [README.md] on current MSRV requirements) and pass fuzz tests on
115112
nightly rust;
@@ -131,8 +128,8 @@ above, before submitting the PR to review:
131128
```shell script
132129
BITCOIN_MSRV=1.29.0 ./contrib/ci.sh
133130
```
134-
Where value in `BITCOIN_MSRV=1.29.0` should be replaced with the current MSRV
135-
from [README.md].
131+
Please replace the value in `BITCOIN_MSRV=1.29.0` with the current MSRV from
132+
[README.md].
136133

137134
NB: Please keep in mind that the script above replaces `Cargo.lock` file, which
138135
is necessary to support current MSRV, incompatible with `stable` and newer cargo
@@ -142,15 +139,16 @@ versions.
142139

143140
Anyone may participate in peer review which is expressed by comments in the pull
144141
request. Typically, reviewers will review the code for obvious errors, as well as
145-
test out the patch set and opine on the technical merits of the patch. PR should
146-
be reviewed first on the conceptual level before focusing on code style or
142+
test out the patch set and opine on the technical merits of the patch. Please,
143+
first review PR on the conceptual level before focusing on code style or
147144
grammar fixes.
148145

149146
### Repository maintainers
150147

151-
For the pull request to be merged we require (a) that all CI test should pass
152-
and (2) at least two "accepts"/ACKs from the repository maintainers – and no
153-
main reasonable "rejects"/NACKs from anybody who reviewed the code.
148+
Pull request merge requirements:
149+
- all CI test should pass,
150+
- at least two "accepts"/ACKs from the repository maintainers
151+
- no reasonable "rejects"/NACKs from anybody who reviewed the code.
154152

155153
Current list of the project maintainers:
156154

@@ -165,19 +163,16 @@ Current list of the project maintainers:
165163

166164
## Coding conventions
167165

168-
Overall, this library must reflect Bitcoin Core approach whenever possible.
169-
However, since many of the things in Bitcoin Core are maintained due to
170-
historical reasons and may represent poor design, Rust-idiomatic style is
171-
preferred to "how it looks in Core" if everyone agrees.
166+
Library reflects Bitcoin Core approach whenever possible.
172167

173168
### Formatting
174169

175170
The repository currently does not use `rustfmt`.
176171

177172
New changes may format the code with `rustfmt`, but they should not re-format
178173
any existing code for maintaining diff size small, keeping `git blame` intact and
179-
reduce review time. All PRs introducing large blocks of re-formatted code will
180-
not be reviewed.
174+
reduce review time. Repository maintainers may not review PRs introducing large
175+
blocks of re-formatted code.
181176

182177
You may check the [discussion on the formatting](https://github.com/rust-bitcoin/rust-bitcoin/issues/172)
183178
and [how it is planned to coordinate it with crate refactoring](https://github.com/rust-bitcoin/rust-bitcoin/pull/525)
@@ -194,14 +189,14 @@ the [tracking issue](https://github.com/rust-bitcoin/rust-bitcoin/issues/510).
194189
### Naming conventions
195190

196191
Naming of data structures/enums and their fields/variants must follow names used
197-
in Bitcoin Core, with except to:
198-
- case, which should follow Rust standards (i.e. PascalCase for types and
199-
snake_case for fields and variants)
200-
- `C`-prefix, which should be omitted
192+
in Bitcoin Core, with the following exceptions:
193+
- the case should follow Rust standards (i.e. PascalCase for types and
194+
snake_case for fields and variants);
195+
- omit `C`-prefixes.
201196

202197
### Unsafe code
203198

204-
Use of `unsafe` code is prohibited unless there is a unanonymous decision among
199+
Use of `unsafe` code is prohibited unless there is a unanimous decision among
205200
library maintainers on the exclusion from this rule. In such cases there is a
206201
requirement to test unsafe code with sanitizers including Miri.
207202

@@ -213,8 +208,8 @@ vulnerabilities helps prevent user loss of funds. If you believe a vulnerability
213208
may affect other implementations, please disclose this information according to
214209
the [security guidelines](./SECURITY.md), work on which is currently in progress.
215210
Before it is completed, feel free to send disclosure to Andrew Poelstra,
216-
[email protected], encrypted with his public key, which may be found
217-
at <https://www.wpsoftware.net/andrew/andrew.gpg>.
211+
[email protected], encrypted with his public key from
212+
<https://www.wpsoftware.net/andrew/andrew.gpg>.
218213

219214

220215
## Testing
@@ -226,7 +221,8 @@ the project to enable fine-grained unit testing is also an ongoing effort.
226221

227222
Fuzzing is heavily encouraged: feel free to add related material under `fuzz/`
228223

229-
Mutation testing is planned; any contribution there would be warmly welcomed.
224+
Mutation testing is planned; any contributions helping with that are highly
225+
welcome!
230226

231227

232228
## Going further

0 commit comments

Comments
 (0)