From 88eba785bb73cda2bfc1553c390e45c3b822b56a Mon Sep 17 00:00:00 2001 From: Mario Carbajal Date: Mon, 8 Jan 2024 09:40:25 -0300 Subject: [PATCH] inherit more properties from workspace --- Cargo.lock | 8 ++++---- Cargo.toml | 6 ++++-- internal/core/src/lib.rs | 6 ++---- stylance-cli/Cargo.toml | 9 +++++---- stylance/Cargo.toml | 10 +++++++--- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9eda3c9..10cbfb6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "core" -version = "1.2.3" +version = "0.0.1" dependencies = [ "anyhow", "serde", @@ -253,7 +253,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "macros" -version = "1.2.3" +version = "0.0.1" dependencies = [ "core", "proc-macro2", @@ -377,14 +377,14 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "stylance" -version = "1.2.3" +version = "0.0.1" dependencies = [ "macros", ] [[package]] name = "stylance-cli" -version = "1.2.3" +version = "0.0.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 626025c..e3dba31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,5 +7,7 @@ core = { path = "./internal/core" } macros = { path = "./internal/macros" } [workspace.package] -version = "1.2.3" -authors = ["Mario Carbajal"] +version = "0.0.1" +license = "MIT OR Apache-2.0" +repository = "https://github.com/basro/stylance-rs" +readme = "README.md" diff --git a/internal/core/src/lib.rs b/internal/core/src/lib.rs index 93f80c6..88008d7 100644 --- a/internal/core/src/lib.rs +++ b/internal/core/src/lib.rs @@ -34,7 +34,7 @@ impl From for Config { } } -#[derive(Deserialize)] +#[derive(Deserialize, Default)] pub struct ConfigToml { pub output: Option, pub extensions: Option>, @@ -78,9 +78,7 @@ pub fn load_config(manifest_dir: &Path) -> anyhow::Result { stylance: Some(config), }), }) => Ok(config.into()), - _ => Err(anyhow!( - "`package.metadata.stylance` not found in Cargo.toml" - )), + _ => Ok(ConfigToml::default().into()), } } diff --git a/stylance-cli/Cargo.toml b/stylance-cli/Cargo.toml index 2c344ab..cec6f2d 100644 --- a/stylance-cli/Cargo.toml +++ b/stylance-cli/Cargo.toml @@ -1,14 +1,15 @@ [package] name = "stylance-cli" -version.workspace = true edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +version.workspace = true +license.workspace = true +repository.workspace = true +readme.workspace = true [dependencies] walkdir = "2.4.0" core = { workspace = true } -clap = { version = "4.4.12", features = ["derive"] } +clap = { version = "4.4.12", features = ["derive", "cargo"] } anyhow = "1.0.79" notify = "6.1.1" diff --git a/stylance/Cargo.toml b/stylance/Cargo.toml index 728d501..c43ee72 100644 --- a/stylance/Cargo.toml +++ b/stylance/Cargo.toml @@ -1,12 +1,16 @@ [package] name = "stylance" -version.workspace = true edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +version.workspace = true +license.workspace = true +repository.workspace = true +readme.workspace = true [features] nightly = ["macros/nightly"] [dependencies] macros = { workspace = true } + +[package.metadata.stylance] +folders = ["examples"]