Skip to content

Commit e8da49a

Browse files
authored
Move rustfmt binariy crates to workspace (#4002)
1 parent b76fff3 commit e8da49a

File tree

29 files changed

+65
-5
lines changed

29 files changed

+65
-5
lines changed

Cargo.toml

+9-5
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,29 @@ 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"
17+
test = false
1718

1819
[[bin]]
1920
name = "cargo-fmt"
20-
path = "src/cargo-fmt/main.rs"
21+
path = "rustfmt-core/rustfmt-bin/src/cargo-fmt/main.rs"
22+
test = false
2123

2224
[[bin]]
2325
name = "rustfmt-format-diff"
24-
path = "src/format-diff/main.rs"
26+
path = "rustfmt-core/rustfmt-bin/src/format-diff/main.rs"
27+
test = false
2528

2629
[[bin]]
2730
name = "git-rustfmt"
28-
path = "src/git-rustfmt/main.rs"
31+
path = "rustfmt-core/rustfmt-bin/src/git-rustfmt/main.rs"
32+
test = false
2933

3034
[features]
3135
default = ["cargo-fmt", "rustfmt-format-diff"]

rustfmt-core/Cargo.toml

+1
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

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

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

+2
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 rustfmt-core/rustfmt-bin/tests/nested-test-files/no-tests-dir/Cargo.toml

+2
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 rustfmt-core/rustfmt-bin/tests/nested-test-files/only-root-level-tests-dir/Cargo.toml

+2
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 rustfmt-core/rustfmt-bin/tests/nested-test-files/root-and-nested-tests/Cargo.toml

+2
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]
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)