diff --git a/flake.nix b/flake.nix index 6f69f81f..486d275f 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ pkgs.esbuild pkgs.go pkgs.go-jet + pkgs.golangci-lint pkgs.goose pkgs.gotools pkgs.lefthook diff --git a/lefthook.yml b/lefthook.yml index 8ab599ee..49838cf6 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -12,6 +12,10 @@ pre-commit: glob: "*.go" run: gofmt -w {staged_files} stage_fixed: true + lint: + glob: "*.go" + run: golangci-lint run --fix + stage_fixed: true prettier: glob: "*.{html,js,ts,vue,scss}" run: prettier -w {staged_files}