# One CLI to format the code tree - https://github.com/numtide/treefmt [formatter.python] command = "black" includes = ["*.py"] [formatter.elm] command = "elm-format" options = ["--yes"] includes = ["*.elm"] [formatter.go] command = "gofmt" options = ["-w"] includes = ["*.go"] [formatter.haskell] command = "ormolu" options = [ "--ghc-opt", "-XBangPatterns", "--ghc-opt", "-XPatternSynonyms", "--ghc-opt", "-XTypeApplications", "--mode", "inplace", "--check-idempotence", ] includes = ["*.hs"] excludes = ["examples/haskell/"] [formatter.nix] command = "nixpkgs-fmt" includes = ["*.nix"] # Act as an example on how to exlude specific files excludes = ["examples/nix/sources.nix"] [formatter.prettier] command = "prettier" options = ["--write"] includes = [ "*.css", "*.html", "*.js", "*.json", "*.jsx", "*.md", "*.mdx", "*.scss", "*.ts", "*.yaml", ] excludes = ["CHANGELOG.md"] [formatter.rust] command = "rustfmt" options = ["--edition", "2018"] includes = ["*.rs"] [formatter.shell] command = "shfmt" options = [ "-i", "2", # indent 2 "-s", # simplify the code "-w", # write back to the file ] includes = ["*.sh"] [formatter.terraform] command = "./scripts/terraform-fmt" includes = ["*.tf"]