From 90276953719d4cf74a94a2fc10d98f1fac0aa4d9 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 3 Apr 2023 17:05:10 +0300 Subject: [PATCH] [#203] node: Add staticcheck target and pre-commit Signed-off-by: Dmitrii Stepanov --- .pre-commit-config.yaml | 5 +++++ Makefile | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 169b7bf1c..db9930e91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,3 +43,8 @@ repos: pass_filenames: false types: [go] language: system + + - repo: https://github.com/TekWizely/pre-commit-golang + rev: v1.0.0-rc.1 + hooks: + - id: go-staticcheck-repo-mod diff --git a/Makefile b/Makefile index 242a7ed1c..7d0f8d9e2 100755 --- a/Makefile +++ b/Makefile @@ -128,10 +128,17 @@ test: @echo "⇒ Running go test" @go test ./... +pre-commit-run: + @pre-commit run -a --hook-stage manual + # Run linters lint: @golangci-lint --timeout=5m run +# Run staticcheck +staticcheck: + @staticcheck ./... + # Run linters in Docker docker/lint: docker run --rm -t \