pub struct Config {
pub commit: CommitConfig,
pub release: ReleaseConfig,
pub hooks: HooksConfig,
pub packages: Vec<PackageConfig>,
}Expand description
Root configuration. Three top-level concerns:
commit— how commits are parsedrelease— how releases are cuthooks— what runs at each lifecycle event
commit:
types: [...]
pattern: '...'
release:
branches: [main]
tag_prefix: "v"
version_files: [Cargo.toml]
channels:
canary: { prerelease: canary }
stable: {}
hooks:
pre_commit: ["cargo fmt --check"]
pre_release: ["cargo test --workspace"]Fields§
§commit: CommitConfig§release: ReleaseConfig§hooks: HooksConfig§packages: Vec<PackageConfig>Monorepo packages.
Implementations§
Source§impl Config
impl Config
Sourcepub fn find_config(dir: &Path) -> Option<(PathBuf, bool)>
pub fn find_config(dir: &Path) -> Option<(PathBuf, bool)>
Find the first config file that exists in the given directory.
Sourcepub fn load(path: &Path) -> Result<Self, ReleaseError>
pub fn load(path: &Path) -> Result<Self, ReleaseError>
Load config from a YAML file. Falls back to defaults if the file doesn’t exist.
Sourcepub fn resolve_package(&self, pkg: &PackageConfig) -> Self
pub fn resolve_package(&self, pkg: &PackageConfig) -> Self
Resolve a package into a full config by merging package overrides.
Sourcepub fn resolve_fixed(&self) -> Self
pub fn resolve_fixed(&self) -> Self
Resolve all packages for fixed versioning mode.
Sourcepub fn resolve_channel(&self, name: &str) -> Result<Self, ReleaseError>
pub fn resolve_channel(&self, name: &str) -> Result<Self, ReleaseError>
Resolve a named release channel.
Sourcepub fn find_package(&self, name: &str) -> Result<&PackageConfig, ReleaseError>
pub fn find_package(&self, name: &str) -> Result<&PackageConfig, ReleaseError>
Find a package by name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more