Skip to main content

anodizer_core/config/
git_config.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4// ---------------------------------------------------------------------------
5// GitConfig
6// ---------------------------------------------------------------------------
7
8/// Git-level tag discovery and sorting settings.
9///
10/// Controls how anodizer discovers and orders tags when determining the current
11/// and previous versions. This is separate from `TagConfig`, which controls
12/// version *bumping* logic.
13#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
14#[serde(default)]
15pub struct GitConfig {
16    /// How to sort git tags when determining the latest version.
17    ///
18    /// Accepted values:
19    /// - `"-version:refname"` (default) — lexicographic version sort on the tag name.
20    /// - `"-version:creatordate"` — sort by the tag's creation date (newest first).
21    pub tag_sort: Option<String>,
22    /// Tag patterns to ignore during version detection (supports templates).
23    /// Tags matching any pattern in this list are excluded from version
24    /// detection entirely.
25    pub ignore_tags: Option<Vec<String>>,
26    /// Tag prefixes to ignore during version detection (supports templates).
27    /// Tags starting with any prefix in this list are excluded.
28    /// Mirrors GoReleaser Pro's ignore_tag_prefixes feature.
29    pub ignore_tag_prefixes: Option<Vec<String>>,
30    /// Suffix that identifies pre-release tags for sorting purposes.
31    /// When set, tags ending with this suffix are treated as pre-releases
32    /// and sorted accordingly during tag discovery.
33    pub prerelease_suffix: Option<String>,
34}