-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from hashicorp/add-golangcilint
golangci-lint workflow
- Loading branch information
Showing
14 changed files
with
117 additions
and
54 deletions.
There are no files selected for viewing
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,20 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: [1.16.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.42 | ||
#only-new-issues: true |
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,41 @@ | ||
run: | ||
timeout: 5m | ||
linters: | ||
#enabled by default: deadcode, errcheck, gosimple, govet, ineffasign, staticcheck, struccheck, typecheck, unused, varcheck | ||
enable: | ||
- whitespace #https://github.com/ultraware/whitespace | ||
# - noctx #https://github.com/sonatard/noctx | ||
- nilerr #https://github.com/gostaticanalysis/nilerr | ||
- nestif #https://github.com/nakabonne/nestif | ||
# - gocritic #https://github.com/go-critic/go-critic #TODO: reasses usefulness | ||
# - goconst #https://github.com/jgautheron/goconst #TODO: reasses usefulness | ||
- exportloopref #https://github.com/kyoh86/exportloopref | ||
# - errname #https://github.com/Antonboom/errname #TODO: reasses usefulness | ||
# - errorlint #https://github.com/polyfloyd/go-errorlint #TODO: reasses usefulness | ||
- bodyclose #https://github.com/timakin/bodyclose | ||
# - cyclop #https://github.com/bkielbasa/cyclop | ||
- errcheck #https://github.com/kisielk/errcheck | ||
- stylecheck #https://github.com/dominikh/go-tools/tree/master/stylecheck | ||
- revive #golint is deprecated and golangci-lint recommends to use revive instead https://github.com/mgechev/revive | ||
#other deprecated lint libraries: maligned, scopelint, interfacer | ||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- unused | ||
- deadcode | ||
linters-settings: | ||
errcheck: | ||
# https://github.com/kisielk/errcheck#excluding-functions | ||
check-type-assertions: true | ||
check-blank: true | ||
|
||
revive: | ||
# see https://github.com/mgechev/revive#available-rules for details. | ||
ignore-generated-header: false #recommended in their configuration | ||
severity: warning | ||
rules: | ||
- name: indent-error-flow #Prevents redundant else statements | ||
severity: warning | ||
- name: useless-break | ||
severity: warning |
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
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