From 96c3d9a656818442800304aae2078a38e2a1ed14 Mon Sep 17 00:00:00 2001 From: Simon Heather <32168619+X-Guardian@users.noreply.github.com> Date: Tue, 8 Aug 2023 18:42:28 +0100 Subject: [PATCH] chore: Fix golangci-lint Configuration (#3645) * Fix golang-ci * Update lint workflows * Removed required checks --- .github/workflows/lint-required.yml | 18 +++------------ .github/workflows/lint.yml | 34 ++--------------------------- .golangci.yml | 5 ++--- 3 files changed, 7 insertions(+), 50 deletions(-) diff --git a/.github/workflows/lint-required.yml b/.github/workflows/lint-required.yml index 2e9a979f4a..6f5451f8d8 100644 --- a/.github/workflows/lint-required.yml +++ b/.github/workflows/lint-required.yml @@ -15,7 +15,9 @@ on: paths-ignore: - '**.go' - 'go.*' - - '.github/workflows/linter.yml' + - '.github/workflows/lint.yml' + - '.github/workflows/lint-required.yml' + - '.golangci.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -28,17 +30,3 @@ jobs: runs-on: ubuntu-22.04 steps: - run: 'echo "No build required"' - - revive: - if: github.event.pull_request.draft == false - name: runner / revive - runs-on: ubuntu-22.04 - steps: - - run: 'echo "No build required"' - - errcheck: - if: github.event.pull_request.draft == false - name: runner / errcheck - runs-on: ubuntu-22.04 - steps: - - run: 'echo "No build required"' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 38c5c359a0..8f35fba1d3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,8 @@ on: paths: - '**.go' - 'go.*' - - '.github/workflows/linter.yml' + - '.github/workflows/lint.yml' + - '.golangci.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -28,35 +29,4 @@ jobs: - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} tool_name: golangci-lint - - # Use revive via golangci-lint binary with "warning" level. - revive: - if: github.event.pull_request.draft == false - name: runner / revive - runs-on: ubuntu-22.04 - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v3 - - name: revive - uses: reviewdog/action-golangci-lint@v2 - with: - golangci_lint_flags: "--disable-all -E revive" - tool_name: revive # Change reporter name. - level: warning # GitHub Status Check won't become failure with this level. - - # You can add more and more supported linters with different config. - errcheck: - if: github.event.pull_request.draft == false - name: runner / errcheck - runs-on: ubuntu-22.04 - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v3 - - name: errcheck - uses: reviewdog/action-golangci-lint@v2 - with: - golangci_lint_flags: "--disable-all -E errcheck" - tool_name: errcheck - level: info diff --git a/.golangci.yml b/.golangci.yml index a55bc4497a..b6a224f249 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,5 @@ linters: enable: - - deadcode - errcheck - gochecknoinits # We don't use goconst because it gives false positives in the tests. @@ -11,10 +10,10 @@ linters: - gosimple - ineffassign - staticcheck - - structcheck - typecheck - unconvert - unused - - varcheck - vet - vetshadow +run: + timeout: 10m