diff --git a/.cargo/config b/.cargo/config index 51ae33910b0..3ac2ce3363c 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,22 +1,22 @@ [alias] # Automatically generates the ast and syntax kinds files -gen-syntax = "run --package tools --bin tools -- gen-syntax" +gen-syntax = "run --package ra_tools --bin ra_tools -- gen-syntax" # Extracts the tests from -gen-tests = "run --package tools --bin tools -- gen-tests" +gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" # Installs ra_lsp_server install-lsp = "install --path crates/ra_lsp_server --force" # Installs ra_lsp_server with the jemalloc feature jinstall-lsp = "install --path crates/ra_lsp_server --force --features jemalloc" # Installs the visual studio code extension -install-code = "run --package tools --bin tools -- install-code" +install-code = "run --package ra_tools --bin ra_tools -- install-code" # Formats the full repository or installs the git hook to do it automatically. -format = "run --package tools --bin tools -- format" -format-hook = "run --package tools --bin tools -- format-hook" +format = "run --package ra_tools --bin ra_tools -- format" +format-hook = "run --package ra_tools --bin ra_tools -- format-hook" # Run clippy -lint = "run --package tools --bin tools -- lint" +lint = "run --package ra_tools --bin ra_tools -- lint" # Runs the fuzzing test suite (currently only parser) -fuzz-tests = "run --package tools --bin tools -- fuzz-tests" +fuzz-tests = "run --package ra_tools --bin ra_tools -- fuzz-tests" render-test = "run --package ra_cli -- render-test" # Parse a file. This should be piped the file contents diff --git a/Cargo.lock b/Cargo.lock index 202c8838cad..579daecf18c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1047,7 +1047,6 @@ dependencies = [ "ra_ide_api 0.1.0", "ra_prof 0.1.0", "ra_syntax 0.1.0", - "tools 0.1.0", ] [[package]] @@ -1227,6 +1226,17 @@ dependencies = [ "text_unit 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ra_tools" +version = "0.1.0" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "teraron 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ra_tt" version = "0.1.0" @@ -1765,17 +1775,6 @@ dependencies = [ "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tools" -version = "0.1.0" -dependencies = [ - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "teraron 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "typenum" version = "1.10.0" diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml index 328b2436f67..3117f4fda19 100644 --- a/crates/ra_cli/Cargo.toml +++ b/crates/ra_cli/Cargo.toml @@ -14,7 +14,6 @@ indicatif = "0.11.0" ra_syntax = { path = "../ra_syntax" } ra_ide_api = { path = "../ra_ide_api" } -tools = { path = "../tools" } ra_batch = { path = "../ra_batch" } ra_hir = { path = "../ra_hir" } ra_db = { path = "../ra_db" } diff --git a/crates/tools/Cargo.toml b/crates/ra_tools/Cargo.toml similarity index 91% rename from crates/tools/Cargo.toml rename to crates/ra_tools/Cargo.toml index f03256a7490..35ea3231b26 100644 --- a/crates/tools/Cargo.toml +++ b/crates/ra_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2018" -name = "tools" +name = "ra_tools" version = "0.1.0" authors = ["rust-analyzer developers"] publish = false diff --git a/crates/tools/src/bin/pre-commit.rs b/crates/ra_tools/src/bin/pre-commit.rs similarity index 84% rename from crates/tools/src/bin/pre-commit.rs rename to crates/ra_tools/src/bin/pre-commit.rs index ea18c0863f3..c514e992b31 100644 --- a/crates/tools/src/bin/pre-commit.rs +++ b/crates/ra_tools/src/bin/pre-commit.rs @@ -2,10 +2,10 @@ use failure::bail; -use tools::{Result, run_rustfmt, run, project_root}; +use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite}; -fn main() -> tools::Result<()> { - run_rustfmt(tools::Overwrite)?; +fn main() -> Result<()> { + run_rustfmt(Overwrite)?; update_staged() } diff --git a/crates/tools/src/lib.rs b/crates/ra_tools/src/lib.rs similarity index 99% rename from crates/tools/src/lib.rs rename to crates/ra_tools/src/lib.rs index 2446fdf287a..61f6b08cd30 100644 --- a/crates/tools/src/lib.rs +++ b/crates/ra_tools/src/lib.rs @@ -121,7 +121,7 @@ pub fn install_format_hook() -> Result<()> { "./.git/hooks/pre-commit" }); if !result_path.exists() { - run("cargo build --package tools --bin pre-commit", ".")?; + run("cargo build --package ra_tools --bin pre-commit", ".")?; if cfg!(windows) { fs::copy("./target/debug/pre-commit.exe", result_path)?; } else { diff --git a/crates/tools/src/main.rs b/crates/ra_tools/src/main.rs similarity index 99% rename from crates/tools/src/main.rs rename to crates/ra_tools/src/main.rs index 8027ff833e2..285071ea538 100644 --- a/crates/tools/src/main.rs +++ b/crates/ra_tools/src/main.rs @@ -1,7 +1,7 @@ use clap::{App, SubCommand}; use core::str; use failure::bail; -use tools::{ +use ra_tools::{ generate, gen_tests, install_format_hook, run, run_with_output, run_rustfmt, Overwrite, Result, run_fuzzer, run_clippy, }; diff --git a/crates/tools/tests/cli.rs b/crates/ra_tools/tests/cli.rs similarity index 94% rename from crates/tools/tests/cli.rs rename to crates/ra_tools/tests/cli.rs index 6f82ae61d97..83640218f7f 100644 --- a/crates/tools/tests/cli.rs +++ b/crates/ra_tools/tests/cli.rs @@ -1,6 +1,6 @@ use walkdir::WalkDir; -use tools::{generate, gen_tests, run_rustfmt, Verify, project_root}; +use ra_tools::{generate, gen_tests, run_rustfmt, Verify, project_root}; #[test] fn generated_grammar_is_fresh() {