style: check formatting using nixpkgs standard and fail early in CI to enforce it #183
|
@ -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