update build

This commit is contained in:
Pavel 2024-04-17 11:52:03 +03:00
parent d108e6d7a2
commit a1124600a6
2 changed files with 19 additions and 41 deletions

View File

@ -22,20 +22,20 @@ jobs:
- name: Set up stable Go version - name: Set up stable Go version
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 'stable' go-version: '1.22'
- name: Get dependencies - name: Get dependencies
run: go mod tidy run: go mod tidy
- name: Lint code with golangci-lint - name: Lint code with golangci-lint
uses: golangci/golangci-lint-action@v3 uses: golangci/golangci-lint-action@v3
with: with:
version: v1.50.1 version: v1.55.2
only-new-issues: true only-new-issues: true
tests: tests:
name: Tests name: Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go-version: ['1.18', '1.19', 'stable'] go-version: ['1.18', '1.19', '1.20', '1.21', '1.22', 'stable']
steps: steps:
- name: Set up Go ${{ matrix.go-version }} - name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3 uses: actions/setup-go@v3

View File

@ -6,26 +6,9 @@ output:
format: colored-line-number format: colored-line-number
sort-results: true sort-results: true
# Linters below do not support go1.18 yet because of generics.
# See https://github.com/golangci/golangci-lint/issues/2649
# - bodyclose
# - sqlclosecheck
linters: linters:
disable-all: true disable-all: true
enable: enable:
- paralleltest
- tparallel
- asciicheck
- asasalint
- varnamelen
- reassign
- nilnil
- nilerr
- nakedret
- goprintffuncname
- typecheck
- errchkjson
- errcheck - errcheck
- gosimple - gosimple
- govet - govet
@ -33,6 +16,7 @@ linters:
- staticcheck - staticcheck
- unused - unused
- unparam - unparam
- bodyclose
- dogsled - dogsled
- dupl - dupl
- errorlint - errorlint
@ -46,6 +30,7 @@ linters:
- godot - godot
- goimports - goimports
- revive - revive
- gomnd
- gosec - gosec
- lll - lll
- makezero - makezero
@ -53,9 +38,10 @@ linters:
- nestif - nestif
- prealloc - prealloc
- predeclared - predeclared
- exportloopref - sqlclosecheck
- unconvert - unconvert
- whitespace - whitespace
- unused
linters-settings: linters-settings:
govet: govet:
@ -64,11 +50,9 @@ linters-settings:
enable: enable:
- assign - assign
- atomic - atomic
- atomicalign
- bools - bools
- buildtag - buildtag
- copylocks - copylocks
- fieldalignment
- httpresponse - httpresponse
- loopclosure - loopclosure
- lostcancel - lostcancel
@ -80,6 +64,7 @@ linters-settings:
- unmarshal - unmarshal
- unreachable - unreachable
- unsafeptr - unsafeptr
- unused
settings: settings:
printf: printf:
funcs: funcs:
@ -137,6 +122,7 @@ linters-settings:
- (github.com/retailcrm/mg-transport-core/core.LoggerInterface).Noticef - (github.com/retailcrm/mg-transport-core/core.LoggerInterface).Noticef
- (github.com/retailcrm/mg-transport-core/core.LoggerInterface).Infof - (github.com/retailcrm/mg-transport-core/core.LoggerInterface).Infof
- (github.com/retailcrm/mg-transport-core/core.LoggerInterface).Debugf - (github.com/retailcrm/mg-transport-core/core.LoggerInterface).Debugf
:
unused: unused:
check-exported: false check-exported: false
unparam: unparam:
@ -147,20 +133,18 @@ linters-settings:
threshold: 200 threshold: 200
errorlint: errorlint:
errorf: true errorf: true
asserts: false
comparison: false
exhaustive: exhaustive:
check-generated: false check-generated: false
default-signifies-exhaustive: false default-signifies-exhaustive: false
funlen: funlen:
lines: 90 lines: 60
statements: 40 statements: 40
gocognit: gocognit:
min-complexity: 25 min-complexity: 25
gocyclo: gocyclo:
min-complexity: 25 min-complexity: 25
goimports: goimports:
local-prefixes: github.com/retailcrm/mg-transport-core local-prefixes: github.com/retailcrm/mg-transport-api-client-go
lll: lll:
line-length: 120 line-length: 120
misspell: misspell:
@ -170,25 +154,23 @@ linters-settings:
whitespace: whitespace:
multi-if: false multi-if: false
multi-func: false multi-func: false
varnamelen:
max-distance: 10
ignore-map-index-ok: true
ignore-type-assert-ok: true
ignore-chan-recv-ok: true
ignore-decls:
- t *testing.T
- e error
- i int
issues: issues:
exclude-rules: exclude-rules:
- path: _test\.go - path: _test\.go
linters: linters:
- dupl
- gomnd
- lll - lll
- bodyclose
- errcheck - errcheck
- sqlclosecheck
- misspell - misspell
- ineffassign - ineffassign
- whitespace - whitespace
- makezero - makezero
- maligned
- ifshort
- errcheck - errcheck
- funlen - funlen
- goconst - goconst
@ -196,10 +178,6 @@ issues:
- gocyclo - gocyclo
- godot - godot
- unused - unused
- errchkjson
- varnamelen
- path: \.go
text: "Error return value of `io.WriteString` is not checked"
exclude-use-default: true exclude-use-default: true
exclude-case-sensitive: false exclude-case-sensitive: false
max-issues-per-linter: 0 max-issues-per-linter: 0
@ -211,4 +189,4 @@ severity:
case-sensitive: false case-sensitive: false
service: service:
golangci-lint-version: 1.50.x golangci-lint-version: 1.55.x