forked from pub-solar/infra
style: check formatting using nixpkgs standard and
fail early in CI to enforce it
This commit is contained in:
parent
5bfb7de44b
commit
affdc02afe
|
@ -46,6 +46,10 @@ jobs:
|
|||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||
useDaemon: false
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
nix --accept-flake-config --access-tokens '' develop --command treefmt --fail-on-change
|
||||
|
||||
- name: Run flake checks
|
||||
run: |
|
||||
# Prevent cache garbage collection by creating GC roots
|
||||
|
|
24
treefmt.toml
Normal file
24
treefmt.toml
Normal file
|
@ -0,0 +1,24 @@
|
|||
[formatter.nix]
|
||||
command = "nix"
|
||||
options = ["fmt"]
|
||||
includes = ["*.nix"]
|
||||
excludes = []
|
||||
|
||||
[formatter.prettier]
|
||||
command = "prettier"
|
||||
options = ["--write"]
|
||||
includes = [
|
||||
"*.json",
|
||||
"*.yaml",
|
||||
"*.md",
|
||||
]
|
||||
|
||||
[formatter.shell]
|
||||
command = "shfmt"
|
||||
options = [
|
||||
"-s",
|
||||
"-w",
|
||||
"-i",
|
||||
"2",
|
||||
]
|
||||
includes = ["*.sh"]
|
Loading…
Reference in a new issue