Skip to content

Commit 2d0ea2f

Browse files
authored
Remove workspace (#4212)
2 parents f73b015 + 3dc07ea commit 2d0ea2f

File tree

1,223 files changed

+165
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,223 files changed

+165
-273
lines changed

.cargo/Makefile.toml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ script:
4747
- |
4848
export CFG_RELEASE_CHANNEL=nightly
4949
export CFG_RELEASE=nightly
50+
which cargo-make || cargo install cargo-make
5051
if [ -z ${INTEGRATION} ]; then
51-
cargo build && cargo test && cargo test -- --ignored && cargo test --manifest-path rustfmt-core/Cargo.toml && cargo test --manifest-path rustfmt-core/Cargo.toml -- --ignored
52+
cargo make build-bins
53+
cargo make test-all
5254
else
5355
./ci/integration.sh
5456
fi

Cargo.lock

Lines changed: 4 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 101 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,132 @@ 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 = "rustfmt-core/rustfmt-bin/build.rs"
10+
build = "build.rs"
1111
categories = ["development-tools"]
1212
edition = "2018"
1313

1414
[[bin]]
1515
name = "rustfmt"
16-
path = "rustfmt-core/rustfmt-bin/src/bin/main.rs"
17-
test = false
16+
path = "src/rustfmt/main.rs"
17+
required-features = ["rustfmt"]
1818

1919
[[bin]]
2020
name = "cargo-fmt"
21-
path = "rustfmt-core/rustfmt-bin/src/cargo-fmt/main.rs"
22-
test = false
21+
path = "src/cargo-fmt/main.rs"
22+
required-features = ["cargo-fmt"]
2323

2424
[[bin]]
2525
name = "rustfmt-format-diff"
26-
path = "rustfmt-core/rustfmt-bin/src/format-diff/main.rs"
27-
test = false
26+
path = "src/format-diff/main.rs"
27+
required-features = ["rustfmt-format-diff"]
2828

2929
[[bin]]
3030
name = "git-rustfmt"
31-
path = "rustfmt-core/rustfmt-bin/src/git-rustfmt/main.rs"
32-
test = false
31+
path = "src/git-rustfmt/main.rs"
32+
required-features = ["git-rustfmt"]
3333

3434
[features]
35-
default = ["cargo-fmt", "rustfmt-format-diff"]
36-
cargo-fmt = ["cargo_metadata"]
37-
rustfmt-format-diff = ["regex", "serde", "serde_json"]
38-
generic-simd = ["rustfmt_lib/generic-simd"]
35+
default = ["config", "emitter"]
36+
cargo-fmt = [
37+
"cargo_metadata",
38+
"structopt",
39+
]
40+
41+
config = [
42+
"dirs",
43+
"rustfmt-config_proc_macro",
44+
"serde",
45+
"serde_json",
46+
"toml",
47+
]
48+
49+
emitter = [
50+
"config",
51+
"diff",
52+
"serde",
53+
"serde_json",
54+
"term",
55+
]
56+
57+
git-rustfmt = [
58+
"env_logger",
59+
"structopt",
60+
]
61+
62+
rustfmt = [
63+
"env_logger",
64+
"structopt",
65+
]
66+
67+
rustfmt-format-diff = [
68+
"env_logger",
69+
"serde",
70+
"serde_json",
71+
"structopt",
72+
]
3973

4074
[dependencies]
75+
annotate-snippets = { version = "0.8", features = ["color"] }
4176
anyhow = "1.0"
77+
bytecount = "0.6"
4278
dunce = "1.0"
43-
env_logger = "0.7"
79+
ignore = "0.4.11"
80+
itertools = "0.8"
81+
lazy_static = "1.0.0"
4482
log = "0.4"
45-
structopt = "0.3"
46-
term = "0.6"
83+
regex = "1.0"
4784
thiserror = "1.0"
85+
unicode_categories = "0.1.1"
86+
unicode-segmentation = "1.0.0"
87+
unicode-width = "0.1.5"
88+
89+
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
90+
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
91+
# for more information.
92+
rustc-workspace-hack = "1.0.0"
4893

4994
cargo_metadata = { version = "0.9", optional = true }
50-
regex = { version = "1.0", optional = true }
51-
serde = { version = "1.0", optional = true }
95+
diff = { version = "0.1", optional = true}
96+
dirs = { version = "2.0", optional = true }
97+
env_logger = { version = "0.7", optional = true }
98+
rustfmt-config_proc_macro = { version = "0.5", path = "config_proc_macro", optional = true }
99+
serde = { version = "1.0", features = ["derive"], optional = true }
52100
serde_json = { version = "1.0", optional = true }
53-
54-
rustfmt_lib = { path = "rustfmt-core/rustfmt-lib", version = "2.0.0-rc.2" }
101+
structopt = { version = "0.3", optional = true }
102+
term = { version = "0.6", optional = true }
103+
toml = { version = "0.5", optional = true }
55104

56105
[dev-dependencies]
57-
lazy_static = "1.0"
106+
env_logger = "0.7"
58107

59-
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
60-
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
61-
# for more information.
62-
rustc-workspace-hack = "1.0.0"
108+
[dependencies.rustc_ast]
109+
package = "rustc-ap-rustc_ast"
110+
version = "659.0.0"
111+
112+
[dependencies.rustc_ast_pretty]
113+
package = "rustc-ap-rustc_ast_pretty"
114+
version = "659.0.0"
115+
116+
[dependencies.rustc_data_structures]
117+
package = "rustc-ap-rustc_data_structures"
118+
version = "659.0.0"
119+
120+
[dependencies.rustc_errors]
121+
package = "rustc-ap-rustc_errors"
122+
version = "659.0.0"
123+
124+
[dependencies.rustc_expand]
125+
package = "rustc-ap-rustc_expand"
126+
version = "659.0.0"
127+
128+
[dependencies.rustc_parse]
129+
package = "rustc-ap-rustc_parse"
130+
version = "659.0.0"
131+
132+
[dependencies.rustc_session]
133+
package = "rustc-ap-rustc_session"
134+
version = "659.0.0"
135+
136+
[dependencies.rustc_span]
137+
package = "rustc-ap-rustc_span"
138+
version = "659.0.0"

Makefile.toml

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
extend = ".cargo/Makefile.toml"
1+
[env]
2+
CFG_RELEASE = { value = "${CARGO_MAKE_RUST_VERSION}", condition = { env_not_set = ["CFG_RELEASE"] } }
3+
CFG_RELEASE_CHANNEL = { value = "${CARGO_MAKE_RUST_CHANNEL}", condition = { env_not_set = ["CFG_RELEASE_CHANNEL"] } }
4+
5+
[tasks.build-bin]
6+
command = "cargo"
7+
args = [
8+
"build",
9+
"--bin",
10+
"rustfmt",
11+
"--bin",
12+
"cargo-fmt",
13+
"--features=rustfmt,cargo-fmt",
14+
]
15+
16+
[tasks.build-bins]
17+
command = "cargo"
18+
args = [
19+
"build",
20+
"--all-features",
21+
"--bins",
22+
]
223

324
[tasks.install]
425
command = "cargo"
@@ -7,25 +28,34 @@ args = [
728
"--path",
829
".",
930
"--force",
10-
"--locked",
31+
"--locked", # Respect Cargo.lock
32+
"--features=rustfmt,cargo-fmt" # Install only rustfmt and cargo-fmt
1133
]
1234

13-
[tasks.test]
14-
clear = true
15-
run_task = { name = ["test-bin", "test-lib"] }
35+
[tasks.test-all]
36+
run_task = { name = ["test", "test-ignored"] }
1637

17-
[tasks.test-bin]
18-
env = { "RUSTFMT_MAKE_MANIFEST_PATH" = "rustfmt-core/rustfmt-bin/Cargo.toml" }
19-
run_task = "test-subproject"
38+
[tasks.test-ignored]
39+
command = "cargo"
40+
args = [
41+
"test",
42+
"--all-features",
43+
"--",
44+
"--ignored",
45+
]
2046

21-
[tasks.test-lib]
22-
env = { "RUSTFMT_MAKE_MANIFEST_PATH" = "rustfmt-core/rustfmt-lib/Cargo.toml" }
23-
run_task = "test-subproject"
47+
[tasks.b]
48+
alias = "build"
49+
50+
[tasks.bb]
51+
alias = "build-bin"
52+
53+
[tasks.bins]
54+
alias = "build-bins"
55+
56+
[tasks.c]
57+
alias = "check"
58+
59+
[tasks.t]
60+
alias = "test"
2461

25-
[tasks.test-subproject]
26-
condition = { env_set = ["RUSTFMT_MAKE_MANIFEST_PATH"] }
27-
script_runner = "@shell"
28-
script = [
29-
"cargo test --manifest-path ${RUSTFMT_MAKE_MANIFEST_PATH}",
30-
"cargo test --manifest-path ${RUSTFMT_MAKE_MANIFEST_PATH} -- --ignored",
31-
]

appveyor.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ install:
4848
build: false
4949

5050
test_script:
51-
- set CFG_RELEASE_CHANNEL=nightly
52-
- set CFG_RELEASE=nightly
53-
- cargo build --verbose
54-
- cargo test
55-
- cargo test -- --ignored
56-
- cargo test --manifest-path rustfmt-core/Cargo.toml
57-
- cargo test --manifest-path rustfmt-core/Cargo.toml -- --ignored
51+
- cargo install cargo-make
52+
- cargo make build-bins
53+
- cargo make test-all
File renamed without changes.

rustfmt-core/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

rustfmt-core/Cargo.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.

rustfmt-core/Makefile.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)