Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Split rustfix into two crates #65

Merged
merged 1 commit into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ description = "Automatically apply the suggestions made by rustc"
repository = "https://github.com/killercup/rustfix"
documentation = "https://docs.rs/rustfix"
readme = "README.md"
version = "0.1.0"
version = "0.2.0"
exclude = [
"etc/*",
"examples/*",
"tests/*",
]

[dependencies]
clap = "2.9.2"
colored = "1.2.0"
quick-error = "1.2.1"
serde = "1.0"
serde_json = "1.0"
Expand All @@ -30,3 +28,11 @@ env_logger = "0.5.0-rc.1"
log = "0.4.1"
pretty_assertions = "0.4.1"
tempdir = "0.3.5"

[workspace]
members = [
"cargo-fix",
]

[patch.crates-io]
rustfix = { path = "." }
13 changes: 13 additions & 0 deletions cargo-fix/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "cargo-fix"
version = "0.2.0"
authors = ["Pascal Hertleif <[email protected]>"]

[dependencies]
clap = "2.9.2"
colored = "1.2.0"
quick-error = "1.2.1"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
rustfix = "0.1.0"
11 changes: 9 additions & 2 deletions src/main.rs → cargo-fix/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ const ALIASES: &[(&str, &[&str])] = &[
];

fn try_main() -> Result<(), ProgramError> {
let matches = App::new("rustfix")
// Quickfix to be usable as rustfix as well as cargo-fix
let args = if ::std::env::args_os().nth(1).map(|x| &x == "fix").unwrap_or(false) {
::std::env::args_os().skip(1)
} else {
::std::env::args_os().skip(0)
};

let matches = App::new("cargo-fix")
.about("Automatically apply suggestions made by rustc")
.version(crate_version!())
.arg(Arg::with_name("clippy")
Expand All @@ -72,7 +79,7 @@ fn try_main() -> Result<(), ProgramError> {
.long("file")
.takes_value(true)
.help("Load errors from the given JSON file (produced by `cargo build --message-format=json`)"))
.get_matches();
.get_matches_from(args);

let mut extra_args = Vec::new();

Expand Down
4 changes: 0 additions & 4 deletions src/bin/cargo-fix.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ extern crate serde_derive;
extern crate serde_json;

use std::collections::HashSet;
use std::error::Error;

pub mod diagnostics;
use diagnostics::{Diagnostic, DiagnosticSpan};
Expand Down