mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-05 13:07:17 +03:00
Updated Home (markdown)
parent
f26d7e7225
commit
f474990e34
21
Home.md
21
Home.md
@ -134,4 +134,25 @@ done
|
||||
"--",
|
||||
]
|
||||
includes = ["*.tf"]
|
||||
```
|
||||
|
||||
## Using treefmt in a nix-build
|
||||
|
||||
```nix
|
||||
{ src # src should point to the project to check the format for
|
||||
, runCommandNoCC
|
||||
, shfmt
|
||||
, rustfmt
|
||||
, treefmt
|
||||
}:
|
||||
runCommandNoCC "treefmt" {
|
||||
# add all your formatters here
|
||||
nativeBuildInputs = [ shfmt rustfmt treefmt ];
|
||||
} ''
|
||||
# keep timestamps so that treefmt is able to detect mtime changes
|
||||
cp --no-preserve=mode --preserve=timestamps -r ${src} source
|
||||
cd source
|
||||
HOME=$TMPDIR treefmt --fail-on-change
|
||||
touch $out
|
||||
'';
|
||||
```
|
Loading…
Reference in New Issue
Block a user