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
{{ message }}
This repository was archived by the owner on Nov 24, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: Readme.md
+41-3Lines changed: 41 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
> **HIGHLY EXPERIMENTAL – MIGHT EAT YOUR CODE**
4
4
5
-
The goal of this tool is to read and apply the suggestions made by rustc (and third-party lints, like those offered by [Clippy](https://github.com/Manishearth/rust-clippy)).
5
+
The goal of this tool is to read and apply the suggestions made by rustc (and third-party lints, like those offered by [Clippy][clippy]).
Make sure the binaries installed by Cargo are in your `$PATH`.
28
+
29
+
## Usage
30
+
31
+
In your project directory, just execute `rustfix`!
32
+
33
+
You probably want to use `rustfix --clippy` to get all the suggestions from [Clippy][clippy] as well. Make sure you have `cargo clippy` installed (`cargo install clippy`).
34
+
35
+
Please note that running `rustfix` multiple times in a project where no file was changed in the meantime will currently not generate any suggesions (as Cargo/Rust will skip the unchanged code and not compile it again).
36
+
37
+
### CLI Options
38
+
39
+
```plain
40
+
rustfix 0.1.0
41
+
Automatically apply suggestions made by rustc
42
+
43
+
USAGE:
44
+
rustfix [FLAGS] [OPTIONS]
45
+
46
+
FLAGS:
47
+
--clippy Use `cargo clippy` for suggestions
48
+
-h, --help Prints help information
49
+
-V, --version Prints version information
50
+
51
+
OPTIONS:
52
+
--from-file <FILE> Read suggestions from file (each line is a JSON object)
53
+
```
54
+
17
55
## Get the example running
18
56
19
57
My current example output for diagnostics is based on [libui-rs](https://github.com/pcwalton/libui-rs). You can find the example JSON in `tests/fixtures/libui-rs/clippy.json`.
@@ -22,10 +60,10 @@ Run `rustfix`:
22
60
23
61
```sh
24
62
$ cd tests/fixtures/libui-rs/
25
-
$ cargo run -- clippy.json
63
+
$ cargo run -- --from-file clippy.json
26
64
```
27
65
28
-
### Generate the diagnostics JSON file yourself
66
+
### Generate the example diagnostics JSON yourself
0 commit comments