Skip to content

Fix makefile #4203

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

Merged
merged 3 commits into from
May 25, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .cargo/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
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]
workspace = false
command = "cargo"
args = [
"build",
"--bin",
"rustfmt",
"--all-features",
]

[tasks.b]
alias = "build"

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

[tasks.c]
alias = "check"

Expand Down
10 changes: 0 additions & 10 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
extend = ".cargo/Makefile.toml"

[tasks.build]
clear = true
command = "cargo"
args = [
"build",
"--manifest-path",
"rustfmt-core/Cargo.toml",
"--workspace",
]

[tasks.install]
command = "cargo"
args = [
Expand Down
3 changes: 1 addition & 2 deletions rustfmt-core/rustfmt-lib/config_proc_macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustfmt-config_proc_macro"
version = "0.5.0"
version = "0.5.1"
authors = ["topecongiro <[email protected]>"]
edition = "2018"
description = "A collection of procedural macros for rustfmt"
Expand All @@ -21,4 +21,3 @@ serde = { version = "1.0", features = ["derive"] }

[features]
default = []
debug-with-rustfmt = []
3 changes: 1 addition & 2 deletions rustfmt-core/rustfmt-lib/config_proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ pub fn config_type(_args: TokenStream, input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as syn::Item);
let output = config_type::define_config_type(&input);

#[cfg(feature = "debug-with-rustfmt")]
{
if std::env::var("RUSTFMT_DEV_DEBUG_PROC_MACRO").is_ok() {
utils::debug_with_rustfmt(&output);
}

Expand Down
3 changes: 1 addition & 2 deletions rustfmt-core/rustfmt-lib/config_proc_macro/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ pub fn is_unit(v: &syn::Variant) -> bool {
}
}

#[cfg(feature = "debug-with-rustfmt")]
/// Pretty-print the output of proc macro using rustfmt.
pub fn debug_with_rustfmt(input: &TokenStream) {
pub(crate) fn debug_with_rustfmt(input: &TokenStream) {
use std::io::Write;
use std::process::{Command, Stdio};

Expand Down