Skip to content

Commit

Permalink
gordon: Configure pre-commit formatting hook
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskala committed Feb 20, 2025
1 parent b6b6852 commit 63c13ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions machines/gordon/work.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
condition = "gitdir:~/IPFabric/";
contents.user.email = "[email protected]";
}
{
condition = "gitdir:~/IPFabric/ipfabric-product";
contents.hooks.pre-commit = pkgs.writeShellApplication {
name = "biome-format-pre-commit";
runtimeInputs = with pkgs; [ biome ];
text = ''
biome check --staged --write --javascript-linter-enabled=false
'';
};
}
];

neovim = {
Expand Down
7 changes: 5 additions & 2 deletions shells/work.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
let
work = pkgs.writeShellApplication {
name = "work";
runtimeInputs = [ pkgs.yarn ];
runtimeInputs = with pkgs; [
biome
yarn
];
text = ''
die() {
printf '%s\n' "$1" >&2 && exit 1
Expand All @@ -18,7 +21,7 @@ let
case "$cmd" in
fmt)
yarn biome check --write --javascript-linter-enabled=false "$@"
biome check --write --javascript-linter-enabled=false "$@"
;;
test)
yarn nx test "$@"
Expand Down

0 comments on commit 63c13ad

Please sign in to comment.