forked from andygrunwald/go-jira
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace linters with golangci-lint (#5)
- Loading branch information
1 parent
6c88ae7
commit 67691df
Showing
3 changed files
with
22 additions
and
29 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 |
---|---|---|
|
@@ -7,35 +7,33 @@ on: | |
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
checks: write | ||
|
||
jobs: | ||
test: | ||
name: Test and lint | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: [ '1.18', '1.17' ] | ||
go: [ '1.22', '1.21' ] | ||
os: [ 'windows-latest', 'ubuntu-latest', 'macOS-latest' ] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
check-latest: true | ||
|
||
- name: Run go fmt (Go ${{ matrix.go }}) | ||
if: runner.os != 'Windows' | ||
run: diff -u <(echo -n) <(gofmt -d -s .) | ||
|
||
- name: Run go vet | ||
run: make vet | ||
|
||
- name: Run staticcheck (Go ${{ matrix.go }}) | ||
uses: dominikh/[email protected] | ||
- name: Run golangci-lint (Go ${{ matrix.go }}) | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
version: "2022.1" | ||
install-go: false | ||
cache-key: ${{ matrix.go }} | ||
version: v1.56 | ||
|
||
- name: Run Unit tests (Go ${{ matrix.go }}) | ||
run: make test |
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,8 @@ | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- errcheck |
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 |
---|---|---|
|
@@ -8,18 +8,5 @@ help: ## Outputs the help. | |
test: ## Runs all unit, integration and example tests. | ||
go test -race -v ./... | ||
|
||
.PHONY: vet | ||
vet: ## Runs go vet (to detect suspicious constructs). | ||
go vet ./... | ||
|
||
.PHONY: fmt | ||
fmt: ## Runs go fmt (to check for go coding guidelines). | ||
gofmt -d -s . | ||
|
||
.PHONY: staticcheck | ||
staticcheck: ## Runs static analysis to prevend bugs, foster code simplicity, performance and editor integration. | ||
go install honnef.co/go/tools/cmd/[email protected] | ||
staticcheck ./... | ||
|
||
.PHONY: all | ||
all: test vet fmt staticcheck ## Runs all source code quality targets (like test, vet, fmt, staticcheck) | ||
all: test |