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 config;
23pub mod converter;
24pub mod emoji;
25pub mod endings;
26pub mod group;
27pub mod header;
28pub mod indent;
29pub mod refs;
30pub mod rename;
31pub mod replace;
32pub mod whitespace;
33
34// Re-export commonly used types
35pub use case::CaseFormat;
36pub use changes::{Change, ChangeRecord};
37pub use combined::{CombinedOptions, CombinedProcessor, CombinedStats};
38pub use config::{Preset, ReformatConfig};
39pub use converter::CaseConverter;
40pub use emoji::{EmojiOptions, EmojiTransformer};
41pub use endings::{EndingsNormalizer, EndingsOptions, LineEnding};
42pub use group::{FileGrouper, GroupOptions, GroupResult, GroupStats};
43pub use header::{HeaderManager, HeaderOptions};
44pub use indent::{IndentNormalizer, IndentOptions, IndentStyle};
45pub use refs::{
46    ApplyResult, FixRecord, ReferenceFix, ReferenceFixer, ReferenceScanner, ScanOptions,
47};
48pub use rename::{CaseTransform, FileRenamer, RenameOptions, SpaceReplace, TimestampFormat};
49pub use replace::{ContentReplacer, ReplaceOptions, ReplacePattern, ReplacePatternConfig};
50pub use whitespace::{WhitespaceCleaner, WhitespaceOptions};
51
52// Re-export Result type
53pub type Result<T> = anyhow::Result<T>;