From a1124600a6b3312d9ce7f4a624936d92443c94a1 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Wed, 17 Apr 2024 11:52:03 +0300 Subject: [PATCH] update build --- .github/workflows/ci.yml | 6 ++--- .golangci.yml | 54 ++++++++++++---------------------------- 2 files changed, 19 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62dcf07..5f567fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,20 +22,20 @@ jobs: - name: Set up stable Go version uses: actions/setup-go@v3 with: - go-version: 'stable' + go-version: '1.22' - name: Get dependencies run: go mod tidy - name: Lint code with golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.50.1 + version: v1.55.2 only-new-issues: true tests: name: Tests runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.18', '1.19', 'stable'] + go-version: ['1.18', '1.19', '1.20', '1.21', '1.22', 'stable'] steps: - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v3 diff --git a/.golangci.yml b/.golangci.yml index 7b3b338..07fbf97 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,26 +6,9 @@ output: format: colored-line-number 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: disable-all: true enable: - - paralleltest - - tparallel - - asciicheck - - asasalint - - varnamelen - - reassign - - nilnil - - nilerr - - nakedret - - goprintffuncname - - typecheck - - errchkjson - errcheck - gosimple - govet @@ -33,6 +16,7 @@ linters: - staticcheck - unused - unparam + - bodyclose - dogsled - dupl - errorlint @@ -46,6 +30,7 @@ linters: - godot - goimports - revive + - gomnd - gosec - lll - makezero @@ -53,9 +38,10 @@ linters: - nestif - prealloc - predeclared - - exportloopref + - sqlclosecheck - unconvert - whitespace + - unused linters-settings: govet: @@ -64,11 +50,9 @@ linters-settings: enable: - assign - atomic - - atomicalign - bools - buildtag - copylocks - - fieldalignment - httpresponse - loopclosure - lostcancel @@ -80,6 +64,7 @@ linters-settings: - unmarshal - unreachable - unsafeptr + - unused settings: printf: funcs: @@ -137,6 +122,7 @@ linters-settings: - (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).Debugf + : unused: check-exported: false unparam: @@ -147,20 +133,18 @@ linters-settings: threshold: 200 errorlint: errorf: true - asserts: false - comparison: false exhaustive: check-generated: false default-signifies-exhaustive: false funlen: - lines: 90 + lines: 60 statements: 40 gocognit: min-complexity: 25 gocyclo: min-complexity: 25 goimports: - local-prefixes: github.com/retailcrm/mg-transport-core + local-prefixes: github.com/retailcrm/mg-transport-api-client-go lll: line-length: 120 misspell: @@ -170,25 +154,23 @@ linters-settings: whitespace: multi-if: 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: exclude-rules: - path: _test\.go linters: + - dupl + - gomnd - lll + - bodyclose - errcheck + - sqlclosecheck - misspell - ineffassign - whitespace - makezero + - maligned + - ifshort - errcheck - funlen - goconst @@ -196,10 +178,6 @@ issues: - gocyclo - godot - unused - - errchkjson - - varnamelen - - path: \.go - text: "Error return value of `io.WriteString` is not checked" exclude-use-default: true exclude-case-sensitive: false max-issues-per-linter: 0 @@ -211,4 +189,4 @@ severity: case-sensitive: false service: - golangci-lint-version: 1.50.x + golangci-lint-version: 1.55.x \ No newline at end of file