Merge pull request #8 from jimeh/update-workflow-actions

This commit is contained in:
2022-12-04 23:24:47 +00:00
committed by GitHub
4 changed files with 32 additions and 33 deletions

View File

@@ -7,11 +7,14 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
version: v1.37
go-version: 1.15
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
env:
VERBOSE: "true"
@@ -19,11 +22,11 @@ jobs:
name: Tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.15
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -37,11 +40,11 @@ jobs:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.15
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -67,18 +70,18 @@ jobs:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.15
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Publish coverage
uses: paambaati/codeclimate-action@v2.7.4
uses: paambaati/codeclimate-action@v3.2.0
env:
VERBOSE: "true"
GOMAXPROCS: 4
@@ -93,11 +96,11 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.15
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -113,11 +116,11 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.15
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

View File

@@ -7,8 +7,9 @@ linters-settings:
golint:
min-confidence: 0
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
lll:
line-length: 80
tab-width: 4
@@ -21,10 +22,10 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dupl
- errcheck
- exportloopref
- funlen
- gochecknoinits
- goconst
@@ -32,7 +33,6 @@ linters:
- gocyclo
- goerr113
- goimports
- golint
- goprintffuncname
- gosec
- gosimple
@@ -44,19 +44,15 @@ linters:
- nlreturn
- noctx
- nolintlint
- scopelint
- revive
- sqlclosecheck
- staticcheck
- structcheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace
issues:
include:
# - EXC0002 # disable excluding of issues about comments from golint
exclude:
- Using the variable on range scope `tt` in function literal
- Using the variable on range scope `tc` in function literal

View File

@@ -48,7 +48,7 @@ endef
$(eval $(call tool,godoc,golang.org/x/tools/cmd/godoc))
$(eval $(call tool,gofumports,mvdan.cc/gofumpt/gofumports))
$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.37))
$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50))
.PHONY: tools
tools: $(TOOLS)

View File

@@ -717,7 +717,7 @@ func TestPrint(t *testing.T) {
for _, tt := range stringTestCases {
t.Run(tt.name, func(t *testing.T) {
got, err := fakeio.Stdout().Do(func() {
Print(tt.s, 5, tt.s)
_, _ = Print(tt.s, 5, tt.s)
})
require.NoError(t, err)
@@ -731,7 +731,7 @@ func TestPrintf(t *testing.T) {
for _, tt := range stringfTestCases {
t.Run(tt.name, func(t *testing.T) {
got, err := fakeio.Stdout().Do(func() {
Printf(tt.s, tt.a...)
_, _ = Printf(tt.s, tt.a...)
})
require.NoError(t, err)
@@ -746,7 +746,7 @@ func TestFprint(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
var buf bytes.Buffer
Fprint(&buf, tt.s, 5, tt.s)
_, _ = Fprint(&buf, tt.s, 5, tt.s)
got := buf.String()
assert.IsType(t, "", got)
@@ -760,7 +760,7 @@ func TestFprintf(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
var buf bytes.Buffer
Fprintf(&buf, tt.s, tt.a...)
_, _ = Fprintf(&buf, tt.s, tt.a...)
got := buf.String()
assert.IsType(t, "", got)