diff --git a/Cargo.lock b/Cargo.lock index 11e9cfd..f824bfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,7 +1487,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.1.2" +version = "1.2.0" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 8712fac..6a45922 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.1.2" +version = "1.2.0" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." diff --git a/src/cmd/transpose.rs b/src/cmd/transpose/lift_to_workspace.rs similarity index 54% rename from src/cmd/transpose.rs rename to src/cmd/transpose/lift_to_workspace.rs index 9a82c7b..9e77a3f 100644 --- a/src/cmd/transpose.rs +++ b/src/cmd/transpose/lift_to_workspace.rs @@ -1,94 +1,27 @@ // SPDX-License-Identifier: GPL-3.0-only // SPDX-FileCopyrightText: Oliver Tale-Yazdi -use super::GlobalArgs; -use crate::{autofix::*, cmd::resolve_dep, grammar::*, log}; - -use cargo_metadata::{Dependency as Dep, DependencyKind, Package}; -use itertools::Itertools; -use semver::{Op, Version, VersionReq}; -use std::{ - collections::{BTreeMap as Map, HashMap}, - fs::canonicalize, +use crate::log; +use crate::{ + cmd::{ + transpose::{canonicalize, AutoFixer, Dep, Op, Version, VersionReq}, + CargoArgs, GlobalArgs, + }, + grammar::{plural, plural_or}, }; - -/// Transpose dependencies in the workspace. -#[derive(Debug, clap::Parser)] -pub struct TransposeCmd { - #[clap(subcommand)] - subcommand: TransposeSubCmd, -} - -impl TransposeCmd { - pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { - match &self.subcommand { - TransposeSubCmd::Dependency(cmd) => cmd.run(global), - TransposeSubCmd::Features(cmd) => { - cmd.run(global); - Ok(()) - }, - } - } -} - -/// Sub-commands of the [Transpose](TransposeCmd) command. -#[derive(Debug, clap::Subcommand)] -pub enum TransposeSubCmd { - #[clap(alias = "dep", alias = "d")] - Dependency(DependencyCmd), - #[clap(alias = "f")] - Features(FeaturesCmd), -} - -#[derive(Debug, clap::Parser)] -pub struct DependencyCmd { - #[clap(subcommand)] - subcommand: DependencySubCmd, -} - -impl DependencyCmd { - pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { - match &self.subcommand { - DependencySubCmd::LiftToWorkspace(cmd) => cmd.run(global), - } - } -} - -#[derive(Debug, clap::Parser)] -pub struct FeaturesCmd { - #[clap(subcommand)] - subcommand: FeaturesSubCmd, -} - -impl FeaturesCmd { - pub fn run(&self, global: &GlobalArgs) { - match &self.subcommand { - FeaturesSubCmd::StripDevOnly(cmd) => cmd.run(global), - } - } -} - -#[derive(Debug, clap::Subcommand)] -pub enum DependencySubCmd { - #[clap(alias = "lift", alias = "l")] - LiftToWorkspace(LiftToWorkspaceCmd), -} - -#[derive(Debug, clap::Subcommand)] -pub enum FeaturesSubCmd { - /// Strip out dev dependencies. - StripDevOnly(StripDevDepsCmd), -} +use cargo_metadata::Package; +use itertools::Itertools; +use std::collections::{BTreeMap as Map, HashMap}; /// Lift up a dependency to the workspace and reference it from all packages. #[derive(Debug, clap::Parser)] pub struct LiftToWorkspaceCmd { #[allow(missing_docs)] #[clap(flatten)] - cargo_args: super::CargoArgs, + cargo_args: CargoArgs, #[clap(index(1))] - dependency: String, + dependencies: Vec, /// Instead of dry-running, actually modify the files. #[clap(long)] @@ -116,42 +49,137 @@ pub enum VersionResolveMode { Latest, } -#[derive(Debug, clap::Parser)] -pub struct StripDevDepsCmd { - #[allow(missing_docs)] - #[clap(flatten)] - cargo_args: super::CargoArgs, - - /// Only consider these packages. - #[clap(long, short = 'p', value_delimiter = ',', verbatim_doc_comment)] - packages: Option>, -} - impl LiftToWorkspaceCmd { pub fn run(&self, g: &GlobalArgs) -> Result<(), String> { g.warn_unstable(); + self.validate_args()?; + + let meta = self.cargo_args.clone().with_workspace(true).load_metadata()?; + let mut fixers = Map::new(); + + for dep in &self.dependencies { + self.run_for_dependency(g, &meta, dep, &mut fixers)?; + } + self.try_apply_changes(&mut fixers) + } + + fn validate_args(&self) -> Result<(), String> { if self.exact_version.is_some() && self.version_resolver != VersionResolveMode::Exact { return Err("Cannot use --exact-version without --version-resolver=exact".to_string()) } + Ok(()) + } - let meta = self.cargo_args.clone().with_workspace(true).load_metadata()?; - log::debug!("Scanning workspace for '{}'", self.dependency); - // version -> crate - let mut by_version = HashMap::>::new(); + fn try_apply_changes( + &self, + fixers: &mut Map, AutoFixer)>, + ) -> Result<(), String> { + let mut modified = 0; + for (_pkg, fixer) in fixers.values_mut() { + if !fixer.modified() { + continue + } + + modified += 1; + if self.fix { + fixer.save()?; + } else if let Some(_pkg) = _pkg { + log::debug!("Would modify {:?}", _pkg.name); + } else { + log::debug!("Would modify the workspace"); + } + } + if modified > 0 && !self.fix { + let s = plural(modified); + Err(format!( + "Held back modifications to {modified} file{s}. Re-run with --fix to apply." + )) + } else { + Ok(()) + } + } + + fn run_for_dependency( + &self, + g: &GlobalArgs, + meta: &cargo_metadata::Metadata, + dep: &str, + fixers: &mut Map, AutoFixer)>, + ) -> Result<(), String> { + let by_version = Self::build_version_index(meta, dep); + let versions = by_version.keys().collect::>(); + let best_version = self.find_best_version(g, dep, &versions, &by_version)?; + log::info!( + "Selected '{} {}'", //: N={}, D={}, B={})", + dep, + &best_version, + ); + + for (pkg, dep) in by_version.values().flatten() { + let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); + let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); + + if !krate_path.starts_with(&allowed_dir) { + log::info!( + "Skipping path outside of the workspace: {:?} (not in {:?})", + krate_path.display(), + allowed_dir.display() + ); + continue + } + + fixers.entry(pkg.name.clone()).or_insert_with(|| { + (Some(pkg.clone()), AutoFixer::from_manifest(&krate_path).unwrap()) + }); + let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); + + let default_feats = dep.uses_default_features.then_some(true); + fixer.lift_dependency(&dep.name, default_feats)?; + } + + // Now create fixer for the root package + let root_manifest_path = meta.workspace_root.join("Cargo.toml"); + fixers.entry("workspace".to_string()).or_insert_with(|| { + (None, AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf()).unwrap()) + }); + let (_, workspace_fixer) = fixers.get_mut("workspace").unwrap(); + + let mut dep = by_version.values().next().unwrap().first().unwrap().1.clone(); + dep.req = best_version.parse().unwrap(); + // We always add `default-features = false` into the workspace: + workspace_fixer.add_workspace_dep(&dep, false)?; + + Ok(()) + } + + /// Index what versions of a crate are used in the workspace. + fn build_version_index( + meta: &cargo_metadata::Metadata, + name: &str, + ) -> HashMap> { + let mut by_version = HashMap::>::new(); for pkg in meta.packages.iter() { for dep in pkg.dependencies.iter() { - if dep.name != self.dependency { + if dep.name != name { continue } by_version.entry(dep.req.clone()).or_default().push((pkg.clone(), dep.clone())); } } + by_version + } - let versions = by_version.keys().collect::>(); - let best_version = match self.version_resolver { + fn find_best_version( + &self, + g: &GlobalArgs, + name: &str, + versions: &[&VersionReq], + by_version: &HashMap>, + ) -> Result { + let found = match self.version_resolver { VersionResolveMode::Exact => self.exact_version.clone().expect("Checked by clippy"), VersionResolveMode::Latest => try_find_latest(by_version.keys())?.to_string(), VersionResolveMode::Unambiguous => { @@ -187,11 +215,11 @@ impl LiftToWorkspaceCmd { }, }; - let hint = format!("cargo upgrade -p {}@{version_hint}", &self.dependency); + let hint = format!("cargo upgrade -p {}@{version_hint}", name); return Err(format!( "\nFound {} different versions of '{}' in the workspace:\n\n{err}\nHint: {}\n", versions.len(), - &self.dependency, + name, g.bold(&hint), )) } else { @@ -199,74 +227,7 @@ impl LiftToWorkspaceCmd { } }, }; - - log::info!( - "Selected '{} {}'", //: N={}, D={}, B={})", - &self.dependency, - &best_version, - ); - - let mut fixers = Map::new(); - for (pkg, dep) in by_version.values().flatten() { - let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); - let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); - - if !krate_path.starts_with(&allowed_dir) { - log::info!( - "Skipping path outside of the workspace: {:?} (not in {:?})", - krate_path.display(), - allowed_dir.display() - ); - continue - } - - fixers - .entry(pkg.name.clone()) - .or_insert_with(|| (pkg, AutoFixer::from_manifest(&krate_path).unwrap())); - let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); - - let default_feats = dep.uses_default_features.then_some(true); - fixer.lift_dependency(&dep.name, default_feats)?; - } - - // Now create fixer for the root package - let root_manifest_path = meta.workspace_root.join("Cargo.toml"); - let mut fixer = AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf())?; - let mut dep = by_version.values().next().unwrap().first().unwrap().1.clone(); - dep.req = best_version.parse().unwrap(); - // We always add `default-features = false` into the workspace: - fixer.add_workspace_dep(&dep, false)?; - - let mut modified = 0; - for (_pkg, fixer) in fixers.values_mut() { - if !fixer.modified() { - continue - } - - modified += 1; - if self.fix { - fixer.save()?; - } else { - log::debug!("Would modify {:?}", _pkg.name); - } - } - if fixer.modified() { - modified += 1; - log::debug!("Would modify the workspace"); - - if self.fix { - fixer.save()?; - } - } - - if modified > 0 && !self.fix { - let s = plural(modified); - Err(format!( - "Held back modifications to {modified} file{s}; re-run with --fix to apply." - )) - } else { - Ok(()) - } + Ok(found) } } @@ -298,64 +259,3 @@ fn try_find_latest<'a, I: Iterator>(reqs: I) -> Result>(); - - for dep in only_dev.iter() { - // Account for renamed crates: - let Some(dep) = resolve_dep(pkg, dep, &meta) else { - eprintln!("Could not resolve dependency '{}'", g.red(&dep.name)); - std::process::exit(1); - }; - - fixer.remove_feature(&format!("{}/", dep.name())); - fixer.remove_feature(&format!("{}?/", dep.name())); - } - - if fixer.modified() { - fixers.insert(pkg.name.clone(), fixer); - } - } - - for fixer in fixers.values_mut() { - fixer.save().unwrap(); - } - } -} diff --git a/src/cmd/transpose/mod.rs b/src/cmd/transpose/mod.rs new file mode 100644 index 0000000..2634977 --- /dev/null +++ b/src/cmd/transpose/mod.rs @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-3.0-only +// SPDX-FileCopyrightText: Oliver Tale-Yazdi + +mod lift_to_workspace; + +use super::GlobalArgs; +use crate::{ + autofix::*, + cmd::{resolve_dep, transpose::lift_to_workspace::LiftToWorkspaceCmd}, +}; + +use cargo_metadata::{Dependency as Dep, DependencyKind}; +use semver::{Op, Version, VersionReq}; +use std::{collections::BTreeMap as Map, fs::canonicalize}; + +/// Transpose dependencies in the workspace. +#[derive(Debug, clap::Parser)] +pub struct TransposeCmd { + #[clap(subcommand)] + subcommand: TransposeSubCmd, +} + +impl TransposeCmd { + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { + match &self.subcommand { + TransposeSubCmd::Dependency(cmd) => cmd.run(global), + TransposeSubCmd::Features(cmd) => { + cmd.run(global); + Ok(()) + }, + } + } +} + +/// Sub-commands of the [Transpose](TransposeCmd) command. +#[derive(Debug, clap::Subcommand)] +pub enum TransposeSubCmd { + #[clap(alias = "dep", alias = "d")] + Dependency(DependencyCmd), + #[clap(alias = "f")] + Features(FeaturesCmd), +} + +#[derive(Debug, clap::Parser)] +pub struct DependencyCmd { + #[clap(subcommand)] + subcommand: DependencySubCmd, +} + +impl DependencyCmd { + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { + match &self.subcommand { + DependencySubCmd::LiftToWorkspace(cmd) => cmd.run(global), + } + } +} + +#[derive(Debug, clap::Parser)] +pub struct FeaturesCmd { + #[clap(subcommand)] + subcommand: FeaturesSubCmd, +} + +impl FeaturesCmd { + pub fn run(&self, global: &GlobalArgs) { + match &self.subcommand { + FeaturesSubCmd::StripDevOnly(cmd) => cmd.run(global), + } + } +} + +#[derive(Debug, clap::Subcommand)] +pub enum DependencySubCmd { + #[clap(alias = "lift", alias = "l")] + LiftToWorkspace(LiftToWorkspaceCmd), +} + +#[derive(Debug, clap::Subcommand)] +pub enum FeaturesSubCmd { + /// Strip out dev dependencies. + StripDevOnly(StripDevDepsCmd), +} + +#[derive(Debug, clap::Parser)] +pub struct StripDevDepsCmd { + #[allow(missing_docs)] + #[clap(flatten)] + cargo_args: super::CargoArgs, + + /// Only consider these packages. + #[clap(long, short = 'p', value_delimiter = ',', verbatim_doc_comment)] + packages: Option>, +} + +impl StripDevDepsCmd { + pub fn run(&self, g: &GlobalArgs) { + g.warn_unstable(); + let meta = self.cargo_args.load_metadata().expect("Loads metadata"); + + let kind = DependencyKind::Development; + // Allowed dir that we can write to. + let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); + + for name in self.packages.iter().flatten() { + if !meta.packages.iter().any(|p| p.name == *name) { + eprintln!("Could not find package named '{}'", g.red(name)); + std::process::exit(1); + } + } + + let mut fixers = Map::new(); + for pkg in meta.packages.iter() { + if let Some(packages) = &self.packages { + if !packages.contains(&pkg.name) { + continue + } + } + + // Are we allowed to modify this file path? + let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); + if !krate_path.starts_with(&allowed_dir) { + continue + } + let mut fixer = AutoFixer::from_manifest(&krate_path).unwrap(); + + // Find all dependencies that are only used as dev dependencies in this package. + let devs = pkg.dependencies.iter().filter(|d| d.kind == kind); + let only_dev = devs + .filter(|dev| { + pkg.dependencies.iter().filter(|d| d.name == dev.name).all(|d| d.kind == kind) + }) + .collect::>(); + + for dep in only_dev.iter() { + // Account for renamed crates: + let Some(dep) = resolve_dep(pkg, dep, &meta) else { + eprintln!("Could not resolve dependency '{}'", g.red(&dep.name)); + std::process::exit(1); + }; + + fixer.remove_feature(&format!("{}/", dep.name())); + fixer.remove_feature(&format!("{}?/", dep.name())); + } + + if fixer.modified() { + fixers.insert(pkg.name.clone(), fixer); + } + } + + for fixer in fixers.values_mut() { + fixer.save().unwrap(); + } + } +} diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index 0ad4bd5..553cbcf 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -51,7 +51,7 @@ cases: - cmd: transpose dependency lift-to-workspace log --version-resolver latest stderr: | [WARN] Unstable feature - do not rely on this! - Held back modifications to 200 files; re-run with --fix to apply. + Held back modifications to 200 files. Re-run with --fix to apply. Error: () code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver exact @@ -59,7 +59,7 @@ cases: error: the following required arguments were not provided: --exact-version - Usage: zepter transpose dependency lift-to-workspace --exact-version --version-resolver --manifest-path --log --offline + Usage: zepter transpose dependency lift-to-workspace --exact-version --version-resolver --manifest-path --log --offline ... For more information, try '--help'. code: 2 @@ -72,15 +72,141 @@ cases: - cmd: transpose dependency lift-to-workspace log --version-resolver exact --exact-version 0.4.20 stderr: | [WARN] Unstable feature - do not rely on this! - Held back modifications to 200 files; re-run with --fix to apply. + Held back modifications to 200 files. Re-run with --fix to apply. Error: () code: 1 - cmd: zepter transpose dependency lift-to-workspace macro_magic stderr: | [WARN] Unstable feature - do not rely on this! - Held back modifications to 3 files; re-run with --fix to apply. + Held back modifications to 3 files. Re-run with --fix to apply. Error: () code: 1 +- cmd: zepter transpose dependency lift-to-workspace --version-resolver latest --fix docify tt-call + stderr: | + [WARN] Unstable feature - do not rely on this! + diff: | + diff --git Cargo.toml Cargo.toml + index e807171b24..9520d7ded5 100644 + --- Cargo.toml + +++ Cargo.toml + @@ -537,0 +538,2 @@ polkavm-derive = "0.8.0" + +docify = { version = "0.2.7", default-features = false } + +tt-call = { version = "1.0.8", default-features = false } + diff --git docs/sdk/Cargo.toml docs/sdk/Cargo.toml + index c998a60148..69001efd3f 100644 + --- docs/sdk/Cargo.toml + +++ docs/sdk/Cargo.toml + @@ -26 +26 @@ simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/client/chain-spec/Cargo.toml substrate/client/chain-spec/Cargo.toml + index 9ab12dc2ad..1142993886 100644 + --- substrate/client/chain-spec/Cargo.toml + +++ substrate/client/chain-spec/Cargo.toml + @@ -37 +37 @@ array-bytes = { version = "6.1" } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/Cargo.toml substrate/frame/Cargo.toml + index 9419eb1597..c9fad44fd9 100644 + --- substrate/frame/Cargo.toml + +++ substrate/frame/Cargo.toml + @@ -50 +50 @@ frame-system-rpc-runtime-api = { default-features = false, path = "../frame/syst + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/bags-list/Cargo.toml substrate/frame/bags-list/Cargo.toml + index b8ab099a06..312fd9dabd 100644 + --- substrate/frame/bags-list/Cargo.toml + +++ substrate/frame/bags-list/Cargo.toml + @@ -37 +37 @@ log = { version = "0.4.17", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/balances/Cargo.toml substrate/frame/balances/Cargo.toml + index e47e916a27..d6913feda6 100644 + --- substrate/frame/balances/Cargo.toml + +++ substrate/frame/balances/Cargo.toml + @@ -27 +27 @@ sp-std = { path = "../../primitives/std", default-features = false } + -docify = "0.2.6" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/fast-unstake/Cargo.toml substrate/frame/fast-unstake/Cargo.toml + index 5d0a5410f8..ff876efc70 100644 + --- substrate/frame/fast-unstake/Cargo.toml + +++ substrate/frame/fast-unstake/Cargo.toml + @@ -33 +33 @@ frame-benchmarking = { path = "../benchmarking", default-features = false, optio + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/paged-list/Cargo.toml substrate/frame/paged-list/Cargo.toml + index 6a2af120f3..81c1fc7b71 100644 + --- substrate/frame/paged-list/Cargo.toml + +++ substrate/frame/paged-list/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/safe-mode/Cargo.toml substrate/frame/safe-mode/Cargo.toml + index 0c59740bef..0f92b88f6a 100644 + --- substrate/frame/safe-mode/Cargo.toml + +++ substrate/frame/safe-mode/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/scheduler/Cargo.toml substrate/frame/scheduler/Cargo.toml + index bca17242d2..f56f20a4d3 100644 + --- substrate/frame/scheduler/Cargo.toml + +++ substrate/frame/scheduler/Cargo.toml + @@ -26 +26 @@ sp-weights = { path = "../../primitives/weights", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/sudo/Cargo.toml substrate/frame/sudo/Cargo.toml + index 409104aeca..427d2c532b 100644 + --- substrate/frame/sudo/Cargo.toml + +++ substrate/frame/sudo/Cargo.toml + @@ -28 +28 @@ sp-std = { path = "../../primitives/std", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml + index ad97ad5146..7947bfdab5 100644 + --- substrate/frame/support/Cargo.toml + +++ substrate/frame/support/Cargo.toml + @@ -36 +36 @@ sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = fal + -tt-call = "1.0.8" + +tt-call = { workspace = true, default-features = true } + @@ -50 +50 @@ serde_json = { version = "1.0.111", default-features = false, features = ["alloc + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/system/Cargo.toml substrate/frame/system/Cargo.toml + index d409460131..af67af608c 100644 + --- substrate/frame/system/Cargo.toml + +++ substrate/frame/system/Cargo.toml + @@ -31 +31 @@ sp-weights = { path = "../../primitives/weights", default-features = false, feat + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/timestamp/Cargo.toml substrate/frame/timestamp/Cargo.toml + index cd0737c6bb..8e1d4cc709 100644 + --- substrate/frame/timestamp/Cargo.toml + +++ substrate/frame/timestamp/Cargo.toml + @@ -33 +33 @@ sp-timestamp = { path = "../../primitives/timestamp", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/treasury/Cargo.toml substrate/frame/treasury/Cargo.toml + index 2dc603e9f9..21656344d1 100644 + --- substrate/frame/treasury/Cargo.toml + +++ substrate/frame/treasury/Cargo.toml + @@ -23 +23 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/tx-pause/Cargo.toml substrate/frame/tx-pause/Cargo.toml + index ace2172454..1e7939774d 100644 + --- substrate/frame/tx-pause/Cargo.toml + +++ substrate/frame/tx-pause/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/primitives/runtime/Cargo.toml substrate/primitives/runtime/Cargo.toml + index f4b1158242..7ee6da716d 100644 + --- substrate/primitives/runtime/Cargo.toml + +++ substrate/primitives/runtime/Cargo.toml + @@ -35 +35 @@ sp-weights = { path = "../weights", default-features = false } + -docify = { version = "0.2.7" } + +docify = { workspace = true, default-features = true } - cmd: zepter transpose dependency lift-to-workspace tt-call --version-resolver latest --fix stderr: | [WARN] Unstable feature - do not rely on this! diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index 57802b5..c423a95 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -36,7 +36,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: | - zepter 1.1.2 + zepter 1.2.0 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 363a88b..f595905 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index fb3d175..fb4b088 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -4,7 +4,7 @@ cases: - cmd: run default stderr: | thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.2.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -13,7 +13,7 @@ cases: stderr: | [INFO] Running workflow 'default' thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.2.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 73b9942..cd0df82 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.1.2 + zepter 1.2.0 - cmd: -V stdout: | - zepter 1.1.2 + zepter 1.2.0