cmakefmt/lib.rs
1// SPDX-FileCopyrightText: Copyright 2026 Puneet Matharu
2//
3// SPDX-License-Identifier: MIT OR Apache-2.0
4
5//! `cmakefmt` is a fast, configurable CMake formatter and parser.
6//!
7//! The crate exposes:
8//!
9//! - configuration types under [`config`]
10//! - parser entry points under [`parser`]
11//! - formatting entry points under [`formatter`]
12//! - command-spec registry types under [`spec`]
13//!
14//! Most embedders will start with [`format_source`] or
15//! [`format_source_with_debug`].
16
17/// Runtime formatter configuration and config-file loading.
18pub mod config;
19/// Shared error types used across parsing, config loading, and formatting.
20pub mod error;
21/// Recursive CMake file discovery helpers used by the CLI and benchmarks.
22pub mod files;
23/// Source-to-source formatting pipeline.
24pub mod formatter;
25/// CMake parser and AST definitions.
26pub mod parser;
27/// Built-in and user-extensible command specification registry.
28pub mod spec;
29
30/// Re-exported configuration entry points.
31pub use config::{
32 convert_legacy_config_files, default_config_template, default_config_template_for,
33 render_effective_config, CaseStyle, CommandConfig, Config, DangleAlign, DumpConfigFormat,
34 PerCommandConfig,
35};
36/// Re-exported error types.
37pub use error::{Error, Result};
38/// Re-exported formatter entry points.
39pub use formatter::{
40 format_source, format_source_with_debug, format_source_with_registry,
41 format_source_with_registry_debug,
42};