mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-15 15:07:48 +00:00
flake: fix formatting checks
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I2e79090e303930b060566aab02f7dd446a6a6964
This commit is contained in:
parent
2d43bc37d0
commit
2423af38f7
1 changed files with 19 additions and 8 deletions
27
flake.nix
27
flake.nix
|
|
@ -91,18 +91,29 @@
|
||||||
# Check if codebase is properly formatted.
|
# Check if codebase is properly formatted.
|
||||||
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
||||||
# or with `nix flake check`
|
# or with `nix flake check`
|
||||||
nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} ''
|
nix-fmt =
|
||||||
alejandra --check ${self} < /dev/null
|
pkgs.runCommand "nix-fmt-check"
|
||||||
touch $out
|
{
|
||||||
'';
|
src = self;
|
||||||
|
nativeBuildInputs = [pkgs.alejandra pkgs.fd];
|
||||||
|
} ''
|
||||||
|
cd "$src"
|
||||||
|
fd -t f -e nix -x alejandra --check '{}'
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
|
||||||
# Check if Markdown sources are properly formatted
|
# Check if Markdown sources are properly formatted
|
||||||
# This can be initiated with `nix build .#checks.<system>.md-fmt`
|
# This can be initiated with `nix build .#checks.<system>.md-fmt`
|
||||||
# or with `nix flake check`
|
# or with `nix flake check`
|
||||||
md-fmt = pkgs.runCommand "md-fmt-check" {nativeBuildInputs = [pkgs.deno];} ''
|
md-fmt =
|
||||||
deno fmt --check ${self} --ext md
|
pkgs.runCommand "md-fmt-check" {
|
||||||
touch $out
|
src = self;
|
||||||
'';
|
nativeBuildInputs = [pkgs.deno pkgs.fd];
|
||||||
|
} ''
|
||||||
|
cd "$src"
|
||||||
|
fd -t f -e md -x deno fmt --check '{}'
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue