Skip to content

Commit

Permalink
Update struct comments and remove unused import
Browse files Browse the repository at this point in the history
Updated the comments for `BumpOptions` struct in `version.rs` to provide more detailed information about each field. Removed an unused import statement in `package.rs`. Also, an optional `dry` field has been added to the `DependentPackage` struct to check simulate run without making any actual changes.
  • Loading branch information
Barsik-sus committed Mar 21, 2024
1 parent 534694d commit 40037d3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
6 changes: 4 additions & 2 deletions module/move/willbe/src/entity/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ mod private
use std::hash::Hash;
use std::path::PathBuf;
use cargo_metadata::{ Dependency, DependencyKind };
use toml_edit::value;

use process_tools::process;
use manifest::{ Manifest, ManifestError };
Expand All @@ -28,7 +27,7 @@ mod private
thiserror,
Result,
for_lib::Error,
for_app::{ format_err, Error as wError, Context },
for_app::{ format_err, Context },
}
};
use action::readme_health_table_renew::Stability;
Expand Down Expand Up @@ -466,6 +465,9 @@ mod private
/// manipulation of the filesystem paths.
pub base_temp_dir : Option< PathBuf >,

/// `dry` - A boolean value indicating whether to do a dry run. If set to `true`, the application performs
/// a simulated run without making any actual changes. If set to `false`, the operations are actually executed.
/// This property is optional and defaults to `true`.
#[ default( true ) ]
pub dry : bool,

Expand Down
21 changes: 18 additions & 3 deletions module/move/willbe/src/entity/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,31 @@ mod private

// qqq : we have to replace the implementation above with the implementation below, don't we?

/// Options for version bumping.
///
/// This struct is used to specify the options for version bumping operations.
/// `BumpOptions` manages the details necessary for the version bump process for crates.
/// This includes the directory of the crate whose version is being bumped, the old and new version numbers,
/// and the set of dependencies of that crate.
#[ derive( Debug, Clone ) ]
pub struct BumpOptions
{
/// `crate_dir` - The directory of the crate which you want to bump the version of. This value is
/// represented by `CrateDir` which indicates the directory of the crate.
pub crate_dir : CrateDir,

/// `old_version` - The version of the crate before the bump. It's represented by `Version` which
/// denotes the old version number of the crate.
pub old_version : Version,

/// `new_version` - The version number to assign to the crate after the bump. It's also represented
/// by `Version` which denotes the new version number of the crate.
pub new_version : Version,

/// `dependencies` - This is a vector containing the directories of all the dependencies of the crate.
/// Each item in the `dependencies` vector indicates a `CrateDir` directory of a single dependency.
pub dependencies : Vec< CrateDir >,

/// `dry` - A boolean indicating whether to do a "dry run". If set to `true`, a simulated run is performed
/// without making actual changes. If set to `false`, the operations are actually executed. This is
/// useful for validating the process of bumping up the version or for testing and debugging.
pub dry : bool,
}

Expand Down

0 comments on commit 40037d3

Please sign in to comment.