-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreefmt.toml
52 lines (48 loc) · 848 Bytes
/
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
# https://github.com/numtide/treefmt/wiki
[formatter.nix]
command = "nixpkgs-fmt"
includes = ["*.nix"]
[formatter.prettier]
command = "prettier"
options = ["--write"]
includes = [
"*.css",
"*.html",
"*.js",
"*.json",
"*.jsx",
"*.md",
"*.mdx",
"*.scss",
"*.ts",
"*.tsx",
]
[formatter.shell]
command = "sh"
options = [
"-eucx",
"""
if [[ $# -le 0 ]]; then exit 0; fi
shellcheck "$@"
shfmt -i 2 -s -w "$@"
"""
]
includes = ["*.sh"]
excludes = [
"packages/common/rebuild.sh",
"shell/scripts/rebuild.sh",
]
[formatter.terraform]
# Terraform fmt only takes one file at the time so we create a wrapper.
# See https://github.com/numtide/treefmt/issues/97
command = "/bin/sh"
options = [
"-euc",
"""
for f in "$@"; do
terraform fmt "$f"
done
""",
"--",
]
includes = ["*.tf"]