Skip to content

Commit

Permalink
Add golangci-lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed May 19, 2023
1 parent 5f2ab9c commit dc0cc86
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: golangci-lint

on:
push:
branches: [main, master]
pull_request:
branches: '**'

jobs:
golangci:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20.4'

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
skip-pkg-cache: true

# Run again as a workaround for https://github.com/golangci/golangci-lint-action/issues/362
- name: golangci-lint
if: ${{ always() }}
run: golangci-lint run
39 changes: 39 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
run:
skip-dirs:
- test-cmds
timeout: 5m

linters:
enable:
- bodyclose
- unused
- gofmt
- govet
- misspell
- nakedret
- unconvert
- paralleltest
disable:
- errcheck
- gosec
- gosimple
- ineffassign
- interfacer
- maligned
- noctx
- staticcheck
- structcheck
- varcheck

linters-settings:
errcheck:
ignore: github.com/go-kit/kit/log:Log
gofmt:
simplify: false

issues:
exclude-rules:
# False positive: https://github.com/kunwardeep/paralleltest/issues/8.
- linters:
- paralleltest
text: "does not use range value in test Run"

0 comments on commit dc0cc86

Please sign in to comment.