-
Notifications
You must be signed in to change notification settings - Fork 141
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 #111 from 99designs/add-golangci-lint
Add golangci-lint and fix linting issues
- Loading branch information
Showing
22 changed files
with
165 additions
and
140 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 @@ | ||
*.go text eol=lf |
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,19 @@ | ||
name: golangci-lint | ||
on: push | ||
jobs: | ||
golangci: | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
name: lint | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.44.2 |
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 |
---|---|---|
@@ -1,35 +1,21 @@ | ||
name: Continuous Integration | ||
on: push | ||
|
||
jobs: | ||
|
||
linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- run: sudo apt-get install pass gnome-keyring dbus-x11 | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
- run: go test -race ./... | ||
- run: go vet ./... | ||
|
||
mac: | ||
runs-on: macOS-latest | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- run: brew install pass gnupg | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
- run: go test -race ./... | ||
- run: go vet ./... | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/checkout@v1 | ||
- run: diff -u <(echo -n) <(gofmt -s -d .) |
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,39 @@ | ||
linters: | ||
enable: | ||
- bodyclose | ||
- contextcheck | ||
- deadcode | ||
- depguard | ||
- durationcheck | ||
- dupl | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- exhaustive | ||
- exportloopref | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- prealloc | ||
- revive | ||
- rowserrcheck | ||
- staticcheck | ||
- structcheck | ||
- thelper | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- wastedassign | ||
- whitespace |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,5 +104,6 @@ func hasBackend(key string) bool { | |
return true | ||
} | ||
} | ||
|
||
return false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "3.9" | ||
services: | ||
keyring: | ||
image: golang:1.17 | ||
volumes: | ||
- .:/usr/local/src/keyring | ||
working_dir: /usr/local/src/keyring |
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.