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/// Markdown post-processing.
30pub mod markdown;
31/// Commit processing pipeline.
32pub mod process;
33/// Common release type.
34pub mod release;
35/// Remote handler.
36#[cfg(feature = "remote")]
37#[allow(async_fn_in_trait)]
38pub mod remote;
39/// Git repository.
40#[cfg(feature = "repo")]
41pub mod repo;
42/// Release statistics.
43pub mod statistics;
44/// Changelog commit processing summary.
45pub mod summary;
46/// Git tag.
47pub mod tag;
48/// Template engine.
49pub mod template;
50
51/// Default configuration file.
52///
53/// This is used for the user stored global configuration and embedded
54/// configuration.
55pub const DEFAULT_CONFIG: &str = "cliff.toml";
56/// List of possible configuration file location.
57///
58/// This list of files is used for finding the
59/// configuration file relative to the project directory. The first file has the highest priority.
60pub const CONFIG_FILES: &[&str] = &["cliff.toml", ".cliff.toml", ".config/cliff.toml"];
61/// Default output file.
62pub const DEFAULT_OUTPUT: &str = "CHANGELOG.md";
63/// Default ignore file.
64pub const IGNORE_FILE: &str = ".cliffignore";
65
66/// Sets a human-readable message on the current progress bar span.
67/// This macro only has effect if the `tracing-indicatif` feature is enabled.
68#[doc(hidden)]
69#[macro_export]
70macro_rules! set_progress_message {
71    ($($arg:tt)*) => {{
72        #[cfg(feature = "tracing-indicatif")]
73        {
74            use tracing::Span;
75            use tracing_indicatif::span_ext::IndicatifSpanExt;
76            let msg = format!($($arg)*);
77            Span::current().pb_set_message(&msg);
78        }
79    }};
80}