Skip to content

Commit

Permalink
Add golangci-lint to CI and resolve warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
  • Loading branch information
austinvazquez committed Jan 15, 2025
1 parent 7495438 commit 7bbea67
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ jobs:
with:
working-directory: src/github.com/containerd/fuse-overlayfs-snapshotter

linters:
name: Linters
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
path: src/github.com/containerd/fuse-overlayfs-snapshotter
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
- uses: golangci/golangci-lint-action@v6
with:
version: v1.63.4
working-directory: src/github.com/containerd/fuse-overlayfs-snapshotter

test:
runs-on: ubuntu-22.04
timeout-minutes: 30
Expand Down
25 changes: 25 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
linters:
enable:
- copyloopvar
- depguard
- gofmt
- gosec
- govet
- ineffassign
- misspell
- nolintlint
- staticcheck
- tenv
- unconvert
- unused
disable:
- errcheck
- revive

linters-settings:
depguard:
rules:
main:
deny:
- pkg: "io/ioutil"
desc: use "io" or "os" instead

0 comments on commit 7bbea67

Please sign in to comment.