Add pre-commit gofmt hook.
This commit is contained in:
parent
34270dfea0
commit
37f1c553b4
4 changed files with 138 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue