Skip to main content

git_cliff_core/
lib.rs

1//! A highly customizable changelog generator ⛰️
2//!
3//! The crate provides a set of optional features that can be enabled in your
4//! `Cargo.toml` file.
5//!
6//! ## Features
7#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
8#![cfg_attr(docsrs, feature(doc_cfg))]
9#![warn(missing_docs, clippy::unwrap_used)]
10#![doc(
11    html_logo_url = "https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff.png",
12    html_favicon_url = "https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/favicon/favicon.ico"
13)]
14
15/// Changelog generator.
16pub mod changelog;
17/// Command runner.
18pub mod command;
19/// Git commit.
20pub mod commit;
21/// Config file parser.
22pub mod config;
23/// Remote contributor.
24pub mod contributor;
25/// Embedded file handler.
26pub mod embed;
27/// Error handling.
28pub mod error;
29/// Commit processing pipeline.
30pub mod process;
31/// Common release type.
32pub mod release;
33/// Remote handler.
34#[cfg(feature = "remote")]
35#[allow(async_fn_in_trait)]
36pub mod remote;
37/// Git repository.
38#[cfg(feature = "repo")]
39pub mod repo;
40/// Release statistics.
41pub mod statistics;
42/// Changelog commit processing summary.
43pub mod summary;
44/// Git tag.
45pub mod tag;
46/// Template engine.
47pub mod template;
48
49/// Default configuration file.
50///
51/// This is used for the user stored global configuration and embedded
52/// configuration.
53pub const DEFAULT_CONFIG: &str = "cliff.toml";
54/// List of possible configuration file location.
55///
56/// This list of files is used for finding the
57/// configuration file relative to the project directory. The first file has the highest priority.
58pub const CONFIG_FILES: &[&str] = &["cliff.toml", ".cliff.toml", ".config/cliff.toml"];
59/// Default output file.
60pub const DEFAULT_OUTPUT: &str = "CHANGELOG.md";
61/// Default ignore file.
62pub const IGNORE_FILE: &str = ".cliffignore";
63
64/// Sets a human-readable message on the current progress bar span.
65/// This macro only has effect if the `tracing-indicatif` feature is enabled.
66#[doc(hidden)]
67#[macro_export]
68macro_rules! set_progress_message {
69    ($($arg:tt)*) => {{
70        #[cfg(feature = "tracing-indicatif")]
71        {
72            use tracing::Span;
73            use tracing_indicatif::span_ext::IndicatifSpanExt;
74            let msg = format!($($arg)*);
75            Span::current().pb_set_message(&msg);
76        }
77    }};
78}