Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

chore: Switch to golangci-lint #837

Merged
merged 3 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ jobs:
with:
go-version-file: "go.mod"
id: go
- name: Install linters
run: "( mkdir linters && cd linters && go get golang.org/x/lint/golint )"
- name: Install golangci-lint
run: |
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2
- uses: reviewdog/[email protected]
with:
reviewdog_version: latest
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: "off" # required for golangci-lint - see https://github.com/keptn/keptn/issues/4000 / https://github.com/golangci/golangci-lint/issues/1833
run: |
reviewdog -reporter=github-pr-review
13 changes: 5 additions & 8 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
runner:
golint:
cmd: golint ./...
gofmt:
cmd: gofmt -l .
errorformat:
- "%f:%l:%c: %m"
level: warning
gofmt:
cmd: gofmt -l -s .|xargs -I{} echo {}:1 file {} is not gofmted
golangci-lint:
cmd: golangci-lint run -E bodyclose,exportloopref,funlen,gocyclo,gosec,nestif,unparam --out-format=line-number ./...
errorformat:
- "%f:%l %m"
govet:
cmd: go vet -all ./...
- "%f:%l:%c: %m"