use derive_builder::Builder;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::analyzer::config::DEFAULT_BODY;
#[derive(
Debug, Clone, Default, JsonSchema, Serialize, Deserialize, Builder,
)]
#[builder(setter(into))]
pub struct RewordedCommit {
pub sha: String,
pub message: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Builder)]
#[builder(setter(into, strip_option), default)]
#[serde(default)] pub struct ChangelogConfig {
pub body: String,
pub skip_ci: bool,
pub skip_chore: bool,
pub skip_miscellaneous: bool,
pub skip_merge_commits: bool,
pub skip_release_commits: bool,
pub skip_shas: Option<Vec<String>>,
pub reword: Option<Vec<RewordedCommit>>,
pub include_author: bool,
}
impl Default for ChangelogConfig {
fn default() -> Self {
Self {
body: DEFAULT_BODY.into(),
skip_ci: false,
skip_chore: false,
skip_miscellaneous: false,
skip_merge_commits: true,
skip_release_commits: true,
skip_shas: None,
reword: None,
include_author: false,
}
}
}