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    /// JSON file formatted with Prettier 3.7.4 `json` parser (`objectWrap: "preserve"`, comments allowed, no trailing commas).
11    Json,
12    /// JSON manifest (`package.json`, `package-lock.json`, `composer.json`) formatted with Prettier 3.7.4 `json-stringify` parser.
13    JsonStringify,
14    /// JSONC file (`.jsonc`, `.cjson`) formatted with Prettier 3.7.4 `jsonc` parser (comments and trailing commas preserved).
15    Jsonc,
16    /// TOML file formatted with VS Code `tamasfe.even-better-toml` (Taplo 0.7.0) defaults.
17    Toml,
18    /// JavaScript file (`.js`, `.mjs`, `.cjs`, `.wxs`) formatted with Prettier 3.7.4.
19    JavaScript,
20    /// TypeScript file (`.ts`, `.mts`, `.cts`) formatted with Prettier 3.7.4.
21    TypeScript,
22    /// TypeScript JSX file (`.tsx`) formatted with Prettier 3.7.4.
23    TypeScriptReact,
24    /// CSS stylesheet (`.css`, `.wxss`) formatted with Prettier 3.7.4.
25    Css,
26    /// SCSS stylesheet (`.scss`) formatted with Prettier 3.7.4.
27    Scss,
28    /// Less stylesheet (`.less`) formatted with Prettier 3.7.4.
29    Less,
30    /// HTML document (`.html`, `.htm`) formatted with Prettier 3.7.4.
31    Html,
32    /// Vue Single-File Component (`.vue`) formatted with Prettier 3.7.4.
33    Vue,
34    /// Generic UTF-8 text/script/config file left verbatim unchanged to match VS Code save behavior.
35    PlainText,
36    /// Generic UTF-8 text file with syntactically meaningful leading tabs (for example `Makefile`), left verbatim unchanged to match VS Code save behavior.
37    PlainTextPreserveTabs,
38    /// Binary, lockfile, certificate, or unsupported file left untouched.
39    Unsupported,
40}