Skip to main content

crate_cli/fmt/driver/
enum.rs

1/// Supported text formatting strategy resolved from a file's name or extension.
2#[derive(Clone, Copy, Debug, Eq, PartialEq)]
3pub enum FileFormatKind {
4    /// Rust source file formatted via derive sorting and `cargo fmt`.
5    Rust,
6    /// Markdown file formatted with VS Code Prettier 3.7.4 alignment.
7    Markdown,
8    /// YAML / YML file formatted with VS Code Prettier 3.7.4 alignment.
9    Yaml,
10    /// Strict JSON file formatted with Prettier 2-space / 80-column rules.
11    Json,
12    /// JSONC file formatted with comment-preserving 2-space indentation.
13    Jsonc,
14    /// TOML file formatted with Taplo/Cargo conventions.
15    Toml,
16    /// Generic UTF-8 text/script/config file normalized to LF and clean trailing whitespace.
17    PlainText,
18    /// Generic UTF-8 text file whose leading tabs are syntactically meaningful (for example `Makefile`).
19    PlainTextPreserveTabs,
20    /// Binary, lockfile, certificate, or unsupported file left untouched.
21    Unsupported,
22}