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"
99repository = " https://github.com/killercup/rustfix"
1010documentation = " https://docs.rs/rustfix"
1111readme = " README.md"
12- version = " 0.1 .0"
12+ version = " 0.2 .0"
1313exclude = [
1414 " etc/*" ,
1515 " examples/*" ,
1616 " tests/*" ,
1717]
1818
1919[dependencies ]
20- clap = " 2.9.2"
21- colored = " 1.2.0"
2220quick-error = " 1.2.1"
2321serde = " 1.0"
2422serde_json = " 1.0"
@@ -30,3 +28,11 @@ env_logger = "0.5.0-rc.1"
3028log = " 0.4.1"
3129pretty_assertions = " 0.4.1"
3230tempdir = " 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])] = &[
5555] ;
5656
5757fn 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" )
5966 . about ( "Automatically apply suggestions made by rustc" )
6067 . version ( crate_version ! ( ) )
6168 . arg ( Arg :: with_name ( "clippy" )
@@ -72,7 +79,7 @@ fn try_main() -> Result<(), ProgramError> {
7279 . long ( "file" )
7380 . takes_value ( true )
7481 . help ( "Load errors from the given JSON file (produced by `cargo build --message-format=json`)" ) )
75- . get_matches ( ) ;
82+ . get_matches_from ( args ) ;
7683
7784 let mut extra_args = Vec :: new ( ) ;
7885
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ extern crate serde_derive;
33extern crate serde_json;
44
55use std:: collections:: HashSet ;
6- use std:: error:: Error ;
76
87pub mod diagnostics;
98use diagnostics:: { Diagnostic , DiagnosticSpan } ;
You can’t perform that action at this time.
0 commit comments