inherit more properties from workspace

This commit is contained in:
Mario Carbajal 2024-01-08 09:40:25 -03:00
parent 685ceed7a4
commit 88eba785bb
5 changed files with 22 additions and 17 deletions

8
Cargo.lock generated
View File

@ -122,7 +122,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]] [[package]]
name = "core" name = "core"
version = "1.2.3" version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"serde", "serde",
@ -253,7 +253,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]] [[package]]
name = "macros" name = "macros"
version = "1.2.3" version = "0.0.1"
dependencies = [ dependencies = [
"core", "core",
"proc-macro2", "proc-macro2",
@ -377,14 +377,14 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]] [[package]]
name = "stylance" name = "stylance"
version = "1.2.3" version = "0.0.1"
dependencies = [ dependencies = [
"macros", "macros",
] ]
[[package]] [[package]]
name = "stylance-cli" name = "stylance-cli"
version = "1.2.3" version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",

View File

@ -7,5 +7,7 @@ core = { path = "./internal/core" }
macros = { path = "./internal/macros" } macros = { path = "./internal/macros" }
[workspace.package] [workspace.package]
version = "1.2.3" version = "0.0.1"
authors = ["Mario Carbajal"] license = "MIT OR Apache-2.0"
repository = "https://github.com/basro/stylance-rs"
readme = "README.md"

View File

@ -34,7 +34,7 @@ impl From<ConfigToml> for Config {
} }
} }
#[derive(Deserialize)] #[derive(Deserialize, Default)]
pub struct ConfigToml { pub struct ConfigToml {
pub output: Option<PathBuf>, pub output: Option<PathBuf>,
pub extensions: Option<Vec<String>>, pub extensions: Option<Vec<String>>,
@ -78,9 +78,7 @@ pub fn load_config(manifest_dir: &Path) -> anyhow::Result<Config> {
stylance: Some(config), stylance: Some(config),
}), }),
}) => Ok(config.into()), }) => Ok(config.into()),
_ => Err(anyhow!( _ => Ok(ConfigToml::default().into()),
"`package.metadata.stylance` not found in Cargo.toml"
)),
} }
} }

View File

@ -1,14 +1,15 @@
[package] [package]
name = "stylance-cli" name = "stylance-cli"
version.workspace = true
edition = "2021" edition = "2021"
version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html license.workspace = true
repository.workspace = true
readme.workspace = true
[dependencies] [dependencies]
walkdir = "2.4.0" walkdir = "2.4.0"
core = { workspace = true } core = { workspace = true }
clap = { version = "4.4.12", features = ["derive"] } clap = { version = "4.4.12", features = ["derive", "cargo"] }
anyhow = "1.0.79" anyhow = "1.0.79"
notify = "6.1.1" notify = "6.1.1"

View File

@ -1,12 +1,16 @@
[package] [package]
name = "stylance" name = "stylance"
version.workspace = true
edition = "2021" edition = "2021"
version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html license.workspace = true
repository.workspace = true
readme.workspace = true
[features] [features]
nightly = ["macros/nightly"] nightly = ["macros/nightly"]
[dependencies] [dependencies]
macros = { workspace = true } macros = { workspace = true }
[package.metadata.stylance]
folders = ["examples"]