From e293fa31c976d9ad4765f375933dce3838712d8a Mon Sep 17 00:00:00 2001 From: timflannagan Date: Tue, 25 Oct 2022 09:00:14 -0400 Subject: [PATCH] Integrate golangci-lint with the CI pipeline Signed-off-by: timflannagan --- .github/workflows/sanity.yaml | 3 +++ .golangci.yaml | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index 9f53b49..516cf83 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -22,6 +22,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version-file: "go.mod" - name: Cache build and module paths uses: actions/cache@v3 diff --git a/.golangci.yaml b/.golangci.yaml index 407ead7..53bf482 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -5,23 +5,27 @@ run: linters: enable: - asciicheck - - deadcode + - bodyclose - depguard - errorlint - gofmt - goimports - importas - - prealloc + - misspell - nestif + - prealloc - revive - - misspell - stylecheck - tparallel - unconvert - unparam + - unused - whitespace linters-settings: + errorlint: + errorf: false + importas: alias: - pkg: k8s.io/api/core/v1 @@ -30,6 +34,8 @@ linters-settings: alias: metav1 - pkg: k8s.io/apimachinery/pkg/api/errors alias: apierrors + - pkg: github.com/operator-framework/deppy/api/v1alpha1 + alias: deppyv1alpha1 goimports: local-prefixes: github.com/operator-framework/deppy