# The formatter multiplexer - https://github.com/numtide/treefmt
# This file configures the formatters that treefmt will use to format files in this project.
# More info: https://treefmt.com/latest/getting-started/configure/#config-file

exclude = [
    "**/.git",
    "**/node_modules",
    "**/dist",
    "**/tmp",
    "**/coverage",
    "**/bench",
    "**/__snapshots__",
    "**/__test__",
    "**/__mocks__",
    "**/__generated__",
    "**/.wrangler",
    "**/.rolldown",
    "**/.docusaurus",
    "**/.tamagui",
    "**/tamagui.css",
    "**/.nx",
    "**/.next",
    "**/.storm",
    "**/.powerlines",
    "**/.shell-shock",
    "**/.earthquake",
    "**/.aftershock",
    "**/workbox*.js",
    "**/sw*.js",
    "**/service-worker.js",
    "**/fallback*.js",
    "**/ios",
    "**/.android",
    "**/.DS_Store",
    "**/Thumbs.db",
    "**/.cspellcache",
    "**/package-lock.*",
    "**/npm-lock.*",
    "**/pnpm-lock.*",
    "**/bun.lockb",
    "**/cargo.lock",
    "**/next-env.d.ts",
    "**/CODEOWNERS",
    "**/yarn.lock",
    "**/jest.config.{js,ts,cjs,cts,mjs,mts,json}",
    "**/jest.setup.{js,ts,cjs,cts,mjs,mts,json}",
    "**/vitest.config.{js,ts,cjs,cts,mjs,mts,json}",
    "**/vitest.setup.{js,ts,cjs,cts,mjs,mts,json}",
    "**/output",
    "**/temp",
    "**/.temp",
    "**/.history",
    "**/.vitepress/cache",
    "**/.nuxt",
    "**/.svelte-kit",
    "**/.vercel",
    "**/.changeset",
    "**/.idea",
    "**/.cache",
    "**/.vite-inspect",
    "**/.yarn",
    "**/*.min.*",
    "**/CHANGELOG*.md",
    "**/CONTRIBUTING.md",
    "**/SECURITY.md",
    "**/CODE_OF_CONDUCT.md",
    "**/PULL_REQUEST_TEMPLATE.md",
    "**/LICENSE*",
    "**/auto-import?(s).d.ts",
    "**/components.d.ts",
    "**/vite.config.*.timestamp-*",
    "**/webpack.config.*.timestamp-*",
    "**/rollup.config.*.timestamp-*",
    "**/nx/**/schema.d.ts",
    "**/nx/**/schema.json",
    "**/nx/**/schema.md",
    "**/nx/**/*.schema.d.ts",
    "**/nx/**/*.schema.json",
    "**/nx/**/*.schema.md",
    "**/nx/**/generators/**/files",
    ".agents/**/*",
    "**/.agents/**/*",
    ".claude/**/*",
    "**/.claude/**/*",
    ".cursor/**/*",
    "**/.cursor/**/*",
    ".codex/**/*",
    "**/.codex/**/*",
    ".opencode/**/*",
    "**/.opencode/**/*",
    ".nx/**/*",
    "**/.nx/**/*"
]

tree-root-file = "storm-workspace.json"

[formatter.nix]
command  = "nixpkgs-fmt"
includes = ["*.nix"]

[formatter.nixfmt]
command  = "nixfmt"
excludes = []
includes = ["*.nix"]
options  = []

[formatter.rust]
command = "rustfmt"
includes = ["*.rs"]
options = [
    "--edition",
    "2024",
    "--config-path",
    "node_modules/@storm-software/linting-tools/rustfmt/config.toml"
]

[formatter.buf]
command  = "buf-wrapper"
excludes = []
includes = ["*.proto"]
options  = []

[formatter.gofmt]
command  = "gofmt"
excludes = ["vendor/*"]
includes = ["*.go"]
options  = ["-w"]

[formatter.prettier]
command = "prettier"
excludes = []
includes = [
    "*.cjs",
    "*.css",
    "*.html",
    "*.js",
    "*.json",
    "*.json5",
    "*.jsx",
    "*.md",
    "*.mdx",
    "*.mjs",
    "*.scss",
    "*.ts",
    "*.tsx",
    "*.vue",
    "*.yaml",
    "*.yml"
]
options = [
    "--write",
    "--ignore-unknown",
    "--no-error-on-unmatched-pattern",
    "--config=node_modules/@storm-software/prettier/exclude-packagejson.json",
    "--ignore-path=node_modules/@storm-software/prettier/.prettierignore-exclude-packagejson",
    "--cache",
    "--cache-location=node_modules/.cache/prettier/workspace.cache"
]

[formatter.taplo]
command = "taplo"
excludes = []
includes = ["*.toml"]
options = [
    "format",
    "--write-mode=overwrite",
    "--config",
    "node_modules/@storm-software/linting-tools/taplo/config.toml",
    "--force",
    "--cache-path",
    "node_modules/.cache/taplo"
]

[formatter.yamllint]
command = "yamllint"
excludes = []
includes = ["*.yaml", "*.yml"]
options = [
    "format",
    "--config",
    "node_modules/@storm-software/linting-tools/yamllint/config.yaml"
]
