-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add lint pipeline using golangci-lint (#565)
Enforce linting to this repository.
- Loading branch information
Showing
21 changed files
with
181 additions
and
139 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache: false | ||
|
||
- uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.55.2 # renovate: datasource=github-releases depName=golangci/golangci-lint | ||
|
||
# In general linting is quite fast with warm caches, but a fresh run might | ||
# take some time. | ||
args: --timeout 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
linters-settings: | ||
errcheck: | ||
exclude-functions: | ||
- (github.com/go-kit/log.Logger).Log | ||
misspell: | ||
locale: US | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(github.com/hetznercloud) | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- errcheck | ||
- exportloopref | ||
- gci | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- prealloc | ||
- revive | ||
- rowserrcheck | ||
- staticcheck | ||
- typecheck | ||
- unparam | ||
- unused | ||
- whitespace | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- errcheck | ||
- path: _test\.go | ||
text: unused-parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.