treefmt/treefmt.toml
Jonas Chevalier f7e2aa079e
expand includes and excludes (#86)
If includes or excludes include a / we consider them to be paths and
expand them.
2021-03-02 17:26:50 +01:00

65 lines
1.1 KiB
TOML

# 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",
]
[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"]