This repository was archived by the owner on Nov 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +31
-10
lines changed Expand file tree Collapse file tree 5 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,14 @@ description = "Automatically apply the suggestions made by rustc"
9
9
repository = " https://github.com/killercup/rustfix"
10
10
documentation = " https://docs.rs/rustfix"
11
11
readme = " README.md"
12
- version = " 0.1 .0"
12
+ version = " 0.2 .0"
13
13
exclude = [
14
14
" etc/*" ,
15
15
" examples/*" ,
16
16
" tests/*" ,
17
17
]
18
18
19
19
[dependencies ]
20
- clap = " 2.9.2"
21
- colored = " 1.2.0"
22
20
quick-error = " 1.2.1"
23
21
serde = " 1.0"
24
22
serde_json = " 1.0"
@@ -30,3 +28,11 @@ env_logger = "0.5.0-rc.1"
30
28
log = " 0.4.1"
31
29
pretty_assertions = " 0.4.1"
32
30
tempdir = " 0.3.5"
31
+
32
+ [workspace ]
33
+ members = [
34
+ " cargo-fix" ,
35
+ ]
36
+
37
+ [patch .crates-io ]
38
+ rustfix = { path = " ." }
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " cargo-fix"
3
+ version = " 0.2.0"
4
+ authors = [" Pascal Hertleif <killercup@gmail.com>" ]
5
+
6
+ [dependencies ]
7
+ clap = " 2.9.2"
8
+ colored = " 1.2.0"
9
+ quick-error = " 1.2.1"
10
+ serde = " 1.0"
11
+ serde_json = " 1.0"
12
+ serde_derive = " 1.0"
13
+ rustfix = " 0.1.0"
Original file line number Diff line number Diff line change @@ -55,7 +55,14 @@ const ALIASES: &[(&str, &[&str])] = &[
55
55
] ;
56
56
57
57
fn try_main ( ) -> Result < ( ) , ProgramError > {
58
- let matches = App :: new ( "rustfix" )
58
+ // Quickfix to be usable as rustfix as well as cargo-fix
59
+ let args = if :: std:: env:: args_os ( ) . nth ( 1 ) . map ( |x| & x == "fix" ) . unwrap_or ( false ) {
60
+ :: std:: env:: args_os ( ) . skip ( 1 )
61
+ } else {
62
+ :: std:: env:: args_os ( ) . skip ( 0 )
63
+ } ;
64
+
65
+ let matches = App :: new ( "cargo-fix" )
59
66
. about ( "Automatically apply suggestions made by rustc" )
60
67
. version ( crate_version ! ( ) )
61
68
. arg ( Arg :: with_name ( "clippy" )
@@ -72,7 +79,7 @@ fn try_main() -> Result<(), ProgramError> {
72
79
. long ( "file" )
73
80
. takes_value ( true )
74
81
. help ( "Load errors from the given JSON file (produced by `cargo build --message-format=json`)" ) )
75
- . get_matches ( ) ;
82
+ . get_matches_from ( args ) ;
76
83
77
84
let mut extra_args = Vec :: new ( ) ;
78
85
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ extern crate serde_derive;
3
3
extern crate serde_json;
4
4
5
5
use std:: collections:: HashSet ;
6
- use std:: error:: Error ;
7
6
8
7
pub mod diagnostics;
9
8
use diagnostics:: { Diagnostic , DiagnosticSpan } ;
You can’t perform that action at this time.
0 commit comments