Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workspace #4212

Merged
merged 8 commits into from
May 31, 2020
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 0 additions & 27 deletions .cargo/Makefile.toml

This file was deleted.

4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ script:
- |
export CFG_RELEASE_CHANNEL=nightly
export CFG_RELEASE=nightly
which cargo-make || cargo install cargo-make
if [ -z ${INTEGRATION} ]; then
cargo build && cargo test && cargo test -- --ignored && cargo test --manifest-path rustfmt-core/Cargo.toml && cargo test --manifest-path rustfmt-core/Cargo.toml -- --ignored
cargo make build-bins
cargo make test-all
else
./ci/integration.sh
fi
Expand Down
37 changes: 4 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 101 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,132 @@ description = "Tool to find and fix Rust formatting issues"
repository = "https://github.com/rust-lang/rustfmt"
readme = "README.md"
license = "Apache-2.0/MIT"
build = "rustfmt-core/rustfmt-bin/build.rs"
build = "build.rs"
categories = ["development-tools"]
edition = "2018"

[[bin]]
name = "rustfmt"
path = "rustfmt-core/rustfmt-bin/src/bin/main.rs"
test = false
path = "src/rustfmt/main.rs"
required-features = ["rustfmt"]

[[bin]]
name = "cargo-fmt"
path = "rustfmt-core/rustfmt-bin/src/cargo-fmt/main.rs"
test = false
path = "src/cargo-fmt/main.rs"
required-features = ["cargo-fmt"]

[[bin]]
name = "rustfmt-format-diff"
path = "rustfmt-core/rustfmt-bin/src/format-diff/main.rs"
test = false
path = "src/format-diff/main.rs"
required-features = ["rustfmt-format-diff"]

[[bin]]
name = "git-rustfmt"
path = "rustfmt-core/rustfmt-bin/src/git-rustfmt/main.rs"
test = false
path = "src/git-rustfmt/main.rs"
required-features = ["git-rustfmt"]

[features]
default = ["cargo-fmt", "rustfmt-format-diff"]
cargo-fmt = ["cargo_metadata"]
rustfmt-format-diff = ["regex", "serde", "serde_json"]
generic-simd = ["rustfmt_lib/generic-simd"]
default = ["config", "emitter"]
cargo-fmt = [
"cargo_metadata",
"structopt",
]

config = [
"dirs",
"rustfmt-config_proc_macro",
"serde",
"serde_json",
"toml",
]

emitter = [
"config",
"diff",
"serde",
"serde_json",
"term",
]

git-rustfmt = [
"env_logger",
"structopt",
]

rustfmt = [
"env_logger",
"structopt",
]

rustfmt-format-diff = [
"env_logger",
"serde",
"serde_json",
"structopt",
]

[dependencies]
annotate-snippets = { version = "0.8", features = ["color"] }
anyhow = "1.0"
bytecount = "0.6"
dunce = "1.0"
env_logger = "0.7"
ignore = "0.4.11"
itertools = "0.8"
lazy_static = "1.0.0"
log = "0.4"
structopt = "0.3"
term = "0.6"
regex = "1.0"
thiserror = "1.0"
unicode_categories = "0.1.1"
unicode-segmentation = "1.0.0"
unicode-width = "0.1.5"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
# for more information.
rustc-workspace-hack = "1.0.0"

cargo_metadata = { version = "0.9", optional = true }
regex = { version = "1.0", optional = true }
serde = { version = "1.0", optional = true }
diff = { version = "0.1", optional = true}
dirs = { version = "2.0", optional = true }
env_logger = { version = "0.7", optional = true }
rustfmt-config_proc_macro = { version = "0.5", path = "config_proc_macro", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }

rustfmt_lib = { path = "rustfmt-core/rustfmt-lib", version = "2.0.0-rc.2" }
structopt = { version = "0.3", optional = true }
term = { version = "0.6", optional = true }
toml = { version = "0.5", optional = true }

[dev-dependencies]
lazy_static = "1.0"
env_logger = "0.7"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
# for more information.
rustc-workspace-hack = "1.0.0"
[dependencies.rustc_ast]
package = "rustc-ap-rustc_ast"
version = "659.0.0"

[dependencies.rustc_ast_pretty]
package = "rustc-ap-rustc_ast_pretty"
version = "659.0.0"

[dependencies.rustc_data_structures]
package = "rustc-ap-rustc_data_structures"
version = "659.0.0"

[dependencies.rustc_errors]
package = "rustc-ap-rustc_errors"
version = "659.0.0"

[dependencies.rustc_expand]
package = "rustc-ap-rustc_expand"
version = "659.0.0"

[dependencies.rustc_parse]
package = "rustc-ap-rustc_parse"
version = "659.0.0"

[dependencies.rustc_session]
package = "rustc-ap-rustc_session"
version = "659.0.0"

[dependencies.rustc_span]
package = "rustc-ap-rustc_span"
version = "659.0.0"
66 changes: 48 additions & 18 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
extend = ".cargo/Makefile.toml"
[env]
CFG_RELEASE = { value = "${CARGO_MAKE_RUST_VERSION}", condition = { env_not_set = ["CFG_RELEASE"] } }
CFG_RELEASE_CHANNEL = { value = "${CARGO_MAKE_RUST_CHANNEL}", condition = { env_not_set = ["CFG_RELEASE_CHANNEL"] } }

[tasks.build-bin]
command = "cargo"
args = [
"build",
"--bin",
"rustfmt",
"--bin",
"cargo-fmt",
"--features=rustfmt,cargo-fmt",
]

[tasks.build-bins]
command = "cargo"
args = [
"build",
"--all-features",
"--bins",
]

[tasks.install]
command = "cargo"
Expand All @@ -7,25 +28,34 @@ args = [
"--path",
".",
"--force",
"--locked",
"--locked", # Respect Cargo.lock
"--features=rustfmt,cargo-fmt" # Install only rustfmt and cargo-fmt
]

[tasks.test]
clear = true
run_task = { name = ["test-bin", "test-lib"] }
[tasks.test-all]
run_task = { name = ["test", "test-ignored"] }

[tasks.test-bin]
env = { "RUSTFMT_MAKE_MANIFEST_PATH" = "rustfmt-core/rustfmt-bin/Cargo.toml" }
run_task = "test-subproject"
[tasks.test-ignored]
command = "cargo"
args = [
"test",
"--all-features",
"--",
"--ignored",
]

[tasks.test-lib]
env = { "RUSTFMT_MAKE_MANIFEST_PATH" = "rustfmt-core/rustfmt-lib/Cargo.toml" }
run_task = "test-subproject"
[tasks.b]
alias = "build"

[tasks.bb]
alias = "build-bin"

[tasks.bins]
alias = "build-bins"

[tasks.c]
alias = "check"

[tasks.t]
alias = "test"

[tasks.test-subproject]
condition = { env_set = ["RUSTFMT_MAKE_MANIFEST_PATH"] }
script_runner = "@shell"
script = [
"cargo test --manifest-path ${RUSTFMT_MAKE_MANIFEST_PATH}",
"cargo test --manifest-path ${RUSTFMT_MAKE_MANIFEST_PATH} -- --ignored",
]
10 changes: 3 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ install:
build: false

test_script:
- set CFG_RELEASE_CHANNEL=nightly
- set CFG_RELEASE=nightly
- cargo build --verbose
- cargo test
- cargo test -- --ignored
- cargo test --manifest-path rustfmt-core/Cargo.toml
- cargo test --manifest-path rustfmt-core/Cargo.toml -- --ignored
- cargo install cargo-make
- cargo make build-bins
- cargo make test-all
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions rustfmt-core/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions rustfmt-core/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions rustfmt-core/Makefile.toml

This file was deleted.

Loading