add treefmt

This commit is contained in:
GTrunSec 2022-04-02 15:40:44 -07:00
parent 91d1041e06
commit f5d82afca7
No known key found for this signature in database
GPG key ID: 2368FAFA4ABDD2A0
11 changed files with 147 additions and 103 deletions

25
treefmt.toml Normal file
View file

@ -0,0 +1,25 @@
[formatter.nix]
command = "alejandra"
includes = ["*.nix"]
excludes = ["./modules/generated/*"]
[formatter.prettier]
command = "prettier"
options = ["--plugin", "prettier-plugin-toml", "--write"]
includes = ["*.md", "*.yaml", "*.toml", "*.json"]
excludes = []
[formatter.black]
command = "black"
includes = ["*.py"]
[formatter.shell]
command = "shfmt"
options = [
"-i",
"2", # indent 2
"-s", # simplify the code
"-w", # write back to the file
]
includes = ["*.sh", "*.bash"]