forked from numtide/treefmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
treefmt.toml
82 lines (71 loc) · 1.52 KB
/
treefmt.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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 exclude specific files
excludes = ["examples/nix/sources.nix"]
[formatter.ruby]
command = "rufo"
options = ["-x"]
includes = ["*.rb"]
[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 = "/bin/sh"
options = [
"-euc",
"""
# First lint all the scripts
shellcheck "$@"
# Then format them
shfmt -i 2 -s -w "$@"
""",
"--", # bash swallows the second argument when using -c
]
includes = ["*.sh"]
[formatter.terraform]
# Careful, only terraform 1.3.0 or later accept a list of files.
# see https://github.com/numtide/treefmt/issues/97
command = "terraform"
options = ["fmt"]
includes = ["*.tf"]