Skip to content

Commit

Permalink
chore: Fix golangci-lint Configuration (runatlantis#3645)
Browse files Browse the repository at this point in the history
* Fix golang-ci

* Update lint workflows

* Removed required checks
  • Loading branch information
X-Guardian authored and ijames-gc committed Feb 13, 2024
1 parent b0a0c15 commit 96c3d9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 50 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/lint-required.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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"'
34 changes: 2 additions & 32 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
linters:
enable:
- deadcode
- errcheck
- gochecknoinits
# We don't use goconst because it gives false positives in the tests.
Expand All @@ -11,10 +10,10 @@ linters:
- gosimple
- ineffassign
- staticcheck
- structcheck
- typecheck
- unconvert
- unused
- varcheck
- vet
- vetshadow
run:
timeout: 10m

0 comments on commit 96c3d9a

Please sign in to comment.