From 98a64dadb9b1687302d8de81cfe68fb06af2404e Mon Sep 17 00:00:00 2001 From: jannfis Date: Thu, 8 Jul 2021 15:28:32 +0200 Subject: [PATCH] chore(ci): Introduce golangci-lint for PRs (#356) * chore(ci): Introduce golangci-lint on PRs Signed-off-by: jannfis --- .github/workflows/lint.yaml | 20 ++++++++++++++++++++ .golangci.yml | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/lint.yaml create mode 100644 .golangci.yml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..43261e158 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,20 @@ +name: Integration tests +on: + pull_request: + branches: + - 'master' + +jobs: + lint_code: + name: Run golangci-lint on PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.38.0 + args: --timeout 5m --exclude SA5011 + only-new-issues: true + diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..2ac64cf13 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,21 @@ +run: + timeout: 2m + skip-files: + - ".*_test\\.go" + skip-dirs: + - vendor/ +linters: + enable: + - vet + - deadcode + - goimports + - varcheck + - structcheck + - ineffassign + - unconvert + - unparam +linters-settings: + goimports: + local-prefixes: github.com/argoproj-labs/argocd-operator +service: + golangci-lint-version: 1.38.0