Add pre-commit gofmt hook.

This commit is contained in:
CronyAkatsuki 2024-03-17 15:06:04 +01:00
parent 34270dfea0
commit 37f1c553b4
4 changed files with 138 additions and 2 deletions

View file

@ -11,12 +11,20 @@
)
, mkGoEnv ? pkgs.mkGoEnv
, gomod2nix ? pkgs.gomod2nix
, pre-commit-hooks
}:
let
goEnv = mkGoEnv { pwd = ./.; };
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
src = ./.;
hooks = {
gofmt.enable = true;
};
};
in
pkgs.mkShell {
inherit (pre-commit-check) shellHook;
packages = [
goEnv
gomod2nix