pub fn determine_bump(commits: &[ConventionalCommit]) -> BumpTypeExpand description
Determines the SemVer BumpType from a list of conventional commits.
Hierarchy:
- If any commit is breaking ->
BumpType::Major - Else if any commit has type “feat” ->
BumpType::Minor - Otherwise ->
BumpType::Patch
§Arguments
commits- Slice of parsed conventional commits.
§Example
use git_claw::core::conventional::{determine_bump, ConventionalCommit};
use git_claw::core::semver::BumpType;
let commits = vec![
ConventionalCommit {
commit_type: "fix".to_string(),
scope: None,
is_breaking: false,
description: "fix bug".to_string(),
},
];
assert_eq!(determine_bump(&commits), BumpType::Patch);