use derive_builder::Builder;
use regex::Regex;
use url::Url;
use crate::config::{prerelease::PrereleaseConfig, resolved::CommitModifiers};
#[derive(Debug, Clone, Builder)]
#[builder(setter(into, strip_option), default)]
pub struct AnalyzerConfig {
pub body: String,
pub skip_ci: bool,
pub skip_chore: bool,
pub skip_doc: bool,
pub skip_test: bool,
pub skip_style: bool,
pub skip_refactor: bool,
pub skip_perf: bool,
pub skip_revert: bool,
pub skip_miscellaneous: bool,
pub skip_merge_commits: bool,
pub skip_release_commits: bool,
pub include_author: bool,
pub tag_prefix: Option<String>,
pub release_link_base_url: Option<Url>,
pub compare_link_base_url: Option<Url>,
pub prerelease: Option<PrereleaseConfig>,
pub release_commit_matcher: Option<Regex>,
pub breaking_always_increment_major: bool,
pub features_always_increment_minor: bool,
pub custom_major_increment_regex: Option<String>,
pub custom_minor_increment_regex: Option<String>,
pub commit_modifiers: CommitModifiers,
}
impl Default for AnalyzerConfig {
fn default() -> Self {
Self {
body: "".into(),
skip_ci: false,
skip_chore: false,
skip_doc: false,
skip_test: false,
skip_style: false,
skip_refactor: false,
skip_perf: false,
skip_revert: false,
skip_miscellaneous: false,
skip_merge_commits: true,
skip_release_commits: true,
include_author: false,
tag_prefix: None,
release_link_base_url: None,
compare_link_base_url: None,
prerelease: None,
release_commit_matcher: None,
breaking_always_increment_major: true,
features_always_increment_minor: true,
custom_major_increment_regex: None,
custom_minor_increment_regex: None,
commit_modifiers: CommitModifiers::default(),
}
}
}