Skip to content

Commit 38ab920

Browse files
author
topecongiro
committed
Move rustfmt binariy crates to workspace
1 parent 6779a94 commit 38ab920

File tree

29 files changed

+66
-5
lines changed

29 files changed

+66
-5
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ description = "Tool to find and fix Rust formatting issues"
77
repository = "https://github.com/rust-lang/rustfmt"
88
readme = "README.md"
99
license = "Apache-2.0/MIT"
10-
build = "build.rs"
10+
build = "rustfmt-core/rustfmt-bin/build.rs"
1111
categories = ["development-tools"]
1212
edition = "2018"
1313

1414
[[bin]]
1515
name = "rustfmt"
16-
path = "src/bin/main.rs"
16+
path = "rustfmt-core/rustfmt-bin/src/bin/main.rs"
1717

1818
[[bin]]
1919
name = "cargo-fmt"
20-
path = "src/cargo-fmt/main.rs"
20+
path = "rustfmt-core/rustfmt-bin/src/cargo-fmt/main.rs"
2121

2222
[[bin]]
2323
name = "rustfmt-format-diff"
24-
path = "src/format-diff/main.rs"
24+
path = "rustfmt-core/rustfmt-bin/src/format-diff/main.rs"
2525

2626
[[bin]]
2727
name = "git-rustfmt"
28-
path = "src/git-rustfmt/main.rs"
28+
path = "rustfmt-core/rustfmt-bin/src/git-rustfmt/main.rs"
2929

3030
[features]
3131
default = ["cargo-fmt", "rustfmt-format-diff"]

rustfmt-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
22
members = [
3+
"rustfmt-bin",
34
"rustfmt-config",
45
"rustfmt-emitter",
56
"rustfmt-lib",

rustfmt-core/rustfmt-bin/Cargo.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[package]
2+
3+
# The metadata of this crate is intentionally removed to avoid publishing this crate by accident.
4+
name = "rustfmt-bin"
5+
version = "2.0.0-rc.1"
6+
edition = "2018"
7+
8+
[[bin]]
9+
name = "rustfmt"
10+
path = "src/bin/main.rs"
11+
12+
[[bin]]
13+
name = "cargo-fmt"
14+
path = "src/cargo-fmt/main.rs"
15+
16+
[[bin]]
17+
name = "rustfmt-format-diff"
18+
path = "src/format-diff/main.rs"
19+
20+
[[bin]]
21+
name = "git-rustfmt"
22+
path = "src/git-rustfmt/main.rs"
23+
24+
[features]
25+
default = ["cargo-fmt", "rustfmt-format-diff"]
26+
cargo-fmt = []
27+
rustfmt-format-diff = []
28+
generic-simd = ["rustfmt_lib/generic-simd"]
29+
30+
[dependencies]
31+
ansi_term = "0.12"
32+
anyhow = "1.0"
33+
cargo_metadata = "0.9"
34+
env_logger = "0.7"
35+
getopts = "0.2"
36+
log = "0.4"
37+
regex = "1.0"
38+
serde = "1.0"
39+
serde_json = "1.0"
40+
structopt = "0.3"
41+
term = "0.6"
42+
thiserror = "1.0"
43+
44+
rustfmt_lib = { path = "../rustfmt-lib", version = "1.0" }
45+
46+
[dev-dependencies]
47+
lazy_static = "1.0"
48+
49+
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
50+
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
51+
# for more information.
52+
rustc-workspace-hack = "1.0.0"
File renamed without changes.
File renamed without changes.

tests/nested-test-files/empty-tests-dir/Cargo.toml renamed to rustfmt-core/rustfmt-bin/tests/nested-test-files/empty-tests-dir/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ version = "0.1.0"
44
authors = ["rustfmt devs <[email protected]>"]
55

66
[dependencies]
7+
8+
[workspace]

tests/nested-test-files/no-tests-dir/Cargo.toml renamed to rustfmt-core/rustfmt-bin/tests/nested-test-files/no-tests-dir/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ version = "0.1.0"
44
authors = ["rustfmt devs <[email protected]>"]
55

66
[dependencies]
7+
8+
[workspace]

tests/nested-test-files/only-root-level-tests-dir/Cargo.toml renamed to rustfmt-core/rustfmt-bin/tests/nested-test-files/only-root-level-tests-dir/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ version = "0.1.0"
44
authors = ["rustfmt devs <[email protected]>"]
55

66
[dependencies]
7+
8+
[workspace]

tests/nested-test-files/root-and-nested-tests/Cargo.toml renamed to rustfmt-core/rustfmt-bin/tests/nested-test-files/root-and-nested-tests/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ authors = ["rustfmt devs <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8+
9+
[workspace]

0 commit comments

Comments
 (0)