Skip to content

Commit 9235a2d

Browse files
committed
Update Contributing.md
1 parent a050bdc commit 9235a2d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Contributing.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,18 @@ wish there weren't. You can leave `FIXME`s, preferably with an issue number.
9595

9696
You may want to run a version of rustfmt from source code as part of a test or
9797
hacking on the rustfmt codebase. It's strongly discouraged to install a version
98-
of rustfmt from source. Instead, run it using `cargo run`, and `--manifest-path`.
98+
of rustfmt from source.
99+
100+
To run `rustfmt` on a file:
101+
102+
```
103+
cargo run --bin rustfmt -- path/to/file.rs
104+
```
105+
106+
If you want to test modified `cargo-fmt`, or run `rustfmt` on the whole project:
99107

100108
```
101-
RUSTFMT="./target/debug/rustfmt" cargo run --bin cargo-fmt -- --manifest-path path/to/project/you/want2test/Cargo.toml
109+
cargo build --bin rustfmt && RUSTFMT="./target/debug/rustfmt" cargo run --bin cargo-fmt -- --manifest-path path/to/project/you/want2test/Cargo.toml
102110
```
103111

104112
### Version-gate formatting changes

0 commit comments

Comments
 (0)