Skip to main content

reformat_core/
lib.rs

1//! # reformat-core
2//!
3//! Core library for code transformation and reformatting.
4//!
5//! Provides case format conversion, whitespace cleaning, emoji transformation,
6//! file renaming, and file grouping with broken reference detection.
7//!
8//! ## Quick Start
9//!
10//! ```rust,no_run
11//! use reformat_core::{WhitespaceCleaner, WhitespaceOptions};
12//!
13//! let options = WhitespaceOptions::default();
14//! let cleaner = WhitespaceCleaner::new(options);
15//! let (files, lines) = cleaner.process(std::path::Path::new("src")).unwrap();
16//! println!("Cleaned {} lines in {} files", lines, files);
17//! ```
18
19pub mod case;
20pub mod changes;
21pub mod combined;
22pub mod converter;
23pub mod emoji;
24pub mod group;
25pub mod refs;
26pub mod rename;
27pub mod whitespace;
28
29// Re-export commonly used types
30pub use case::CaseFormat;
31pub use changes::{Change, ChangeRecord};
32pub use combined::{CombinedOptions, CombinedProcessor, CombinedStats};
33pub use converter::CaseConverter;
34pub use emoji::{EmojiOptions, EmojiTransformer};
35pub use group::{FileGrouper, GroupOptions, GroupResult, GroupStats};
36pub use refs::{
37    ApplyResult, FixRecord, ReferenceFix, ReferenceFixer, ReferenceScanner, ScanOptions,
38};
39pub use rename::{CaseTransform, FileRenamer, RenameOptions, SpaceReplace, TimestampFormat};
40pub use whitespace::{WhitespaceCleaner, WhitespaceOptions};
41
42// Re-export Result type
43pub type Result<T> = anyhow::Result<T>;