You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Contributing.md
+58-17Lines changed: 58 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -14,40 +14,73 @@ Conduct](CODE_OF_CONDUCT.md).
14
14
Rustfmt requires a nightly compiler. Replace all invocations of `cargo` by
15
15
`cargo +nightly` if necessary.
16
16
17
-
At all times the environment variables `CFG_RELEASE_CHANNEL` and `CFG_RELEASE` must
18
-
be set to either `nightly` or `beta`. Both should be set to the same value. The
19
-
project supports [cargo-make](https://github.com/sagiegurari/cargo-make) which
20
-
automatically sets these variables for you:
17
+
At all times the environment variables `CFG_RELEASE_CHANNEL` and `CFG_RELEASE` must be set. `CFG_RELEASE_CHANNEL` must be set to either `nightly` or `beta`, and `CFG_RELEASE` should be set to your corresponding Rust version. The
18
+
project supports and recommends [cargo-make][cargo-make] when working on rustfmt, because `cargo-make` automatically sets these variables for you
21
19
20
+
The available tasks are listed in `Makefile.toml`.
21
+
22
+
You can alternatively use `cargo` directly, but you'll have to set the `CFG_RELEASE` and `CFG_RELEASE_CHANNEL` environment variables and also provide the corresponding features.
23
+
24
+
For example:
25
+
```sh
26
+
export CFG_RELEASE=1.45.0-nightly
27
+
export CFG_RELEASE=nightly
22
28
```
23
-
cargo +nightly make test
29
+
(Windows users can use `set` to specify the environment variable values)
30
+
31
+
## Building
32
+
To build with `cargo make`:
33
+
34
+
```sh
35
+
cargo make build
24
36
```
25
37
26
-
The available tasks are listed in `Makefile.toml`.
Some `rewrite_*` methods use the `debug!` macro for printing useful information.
@@ -82,7 +117,13 @@ and get a better grasp on the execution flow.
82
117
83
118
## Hack!
84
119
85
-
Here are some [good starting issues](https://github.com/rust-lang/rustfmt/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-issue).
120
+
There are a lot of open issues on the backlog for those interested in hacking on rustfmt. If you find an issue that you are interested in working on, add a comment to the issue to let us (and other potential contributors) know!
(Windows users can use `set` to specify the environment variable values)
90
101
91
102
This will install `rustfmt` in your `~/.cargo/bin`. Make sure to add `~/.cargo/bin` directory to
92
103
your PATH variable.
@@ -146,9 +157,42 @@ for more info.
146
157
147
158
## How to build and test
148
159
149
-
`cargo build` to build.
160
+
We recommend using [cargo make][cargo-make] when working with the rustfmt codebase.
161
+
162
+
You can alternatively use `cargo` directly, but you'll have to set the `CFG_RELEASE` and `CFG_RELEASE_CHANNEL` environment variables and also provide the corresponding features.
163
+
164
+
For example:
165
+
```sh
166
+
export CFG_RELEASE=1.45.0-nightly
167
+
export CFG_RELEASE=nightly
168
+
```
169
+
(Windows users can use `set` to specify the environment variable values)
0 commit comments