mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-26 17:30:03 +03:00
f7e2aa079e
If includes or excludes include a / we consider them to be paths and expand them.
65 lines
1.1 KiB
TOML
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"]
|