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