mirror of
https://github.com/orhun/git-cliff.git
synced 2025-01-07 15:48:56 +03:00
docs(lib): add comments to struct fields
This commit is contained in:
parent
345c410a62
commit
fbdce067f5
@ -4,19 +4,27 @@ use regex::Regex;
|
|||||||
/// Configuration values.
|
/// Configuration values.
|
||||||
#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)]
|
#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
/// Configuration values about changelog generation.
|
||||||
pub changelog: ChangelogConfig,
|
pub changelog: ChangelogConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Changelog configuration.
|
/// Changelog configuration.
|
||||||
#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)]
|
#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)]
|
||||||
pub struct ChangelogConfig {
|
pub struct ChangelogConfig {
|
||||||
|
/// Changelog header.
|
||||||
pub header: String,
|
pub header: String,
|
||||||
|
/// Changelog body, template.
|
||||||
pub body: String,
|
pub body: String,
|
||||||
|
/// Changelog footer.
|
||||||
pub footer: String,
|
pub footer: String,
|
||||||
|
/// Git commit parsers.
|
||||||
pub commit_parsers: Vec<CommitParser>,
|
pub commit_parsers: Vec<CommitParser>,
|
||||||
|
/// Whether to filter out commits.
|
||||||
pub filter_group: bool,
|
pub filter_group: bool,
|
||||||
|
/// Blob pattern for git tags.
|
||||||
pub git_tag_pattern: String,
|
pub git_tag_pattern: String,
|
||||||
#[serde(with = "serde_regex")]
|
#[serde(with = "serde_regex")]
|
||||||
|
/// Regex to skip matched tags.
|
||||||
pub skip_tags_regex: Regex,
|
pub skip_tags_regex: Regex,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,9 +32,12 @@ pub struct ChangelogConfig {
|
|||||||
#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)]
|
#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CommitParser {
|
pub struct CommitParser {
|
||||||
|
/// Regex for matching commit message.
|
||||||
#[serde(with = "serde_regex")]
|
#[serde(with = "serde_regex")]
|
||||||
pub regex: Regex,
|
pub regex: Regex,
|
||||||
|
/// Group of the commit.
|
||||||
pub group: Option<String>,
|
pub group: Option<String>,
|
||||||
|
/// Whether to skip this commit group.
|
||||||
pub skip: Option<bool>,
|
pub skip: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
//! Highly customizable Changelog Generator
|
||||||
|
#![warn(missing_docs, clippy::unwrap_used)]
|
||||||
|
|
||||||
/// Git commit.
|
/// Git commit.
|
||||||
pub mod commit;
|
pub mod commit;
|
||||||
/// Config file parser.
|
/// Config file parser.
|
||||||
|
@ -25,9 +25,13 @@ pub struct ReleaseRoot<'a> {
|
|||||||
)]
|
)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Release<'a> {
|
pub struct Release<'a> {
|
||||||
|
/// Release version, git tag.
|
||||||
pub version: Option<String>,
|
pub version: Option<String>,
|
||||||
|
/// Commits made for the release.
|
||||||
pub commits: Vec<Commit<'a>>,
|
pub commits: Vec<Commit<'a>>,
|
||||||
#[serde(rename = "commit_id")]
|
#[serde(rename = "commit_id")]
|
||||||
|
/// Commit ID of the tag.
|
||||||
pub commit_id: Option<String>,
|
pub commit_id: Option<String>,
|
||||||
|
/// Timestamp of the release.
|
||||||
pub timestamp: i64,
|
pub timestamp: i64,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user