1
0
mirror of synced 2024-11-21 20:36:06 +03:00

update linter

This commit is contained in:
Pavel 2022-07-29 15:44:46 +03:00
parent 5bdc2eb804
commit 2af7845f3b
2 changed files with 19 additions and 14 deletions

View File

@ -19,10 +19,17 @@ jobs:
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Lint code with golangci-lint
uses: golangci/golangci-lint-action@v2
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
version: v1.36
# TODO: Should migrate to 1.18 later
go-version: '1.17'
- name: Get dependencies
run: go mod tidy
- name: Lint code with golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.42.1
only-new-issues: true
tests:
name: Tests

View File

@ -32,19 +32,15 @@ linters:
- gocyclo
- godot
- goimports
- golint
- gomnd
- revive
- gosec
- ifshort
- interfacer
- lll
- makezero
- maligned
- misspell
- nestif
- prealloc
- predeclared
- scopelint
- sqlclosecheck
- unconvert
- whitespace
@ -56,9 +52,11 @@ linters-settings:
enable:
- assign
- atomic
- atomicalign
- bools
- buildtag
- copylocks
- fieldalignment
- httpresponse
- loopclosure
- lostcancel
@ -140,15 +138,13 @@ linters-settings:
gocyclo:
min-complexity: 25
goimports:
local-prefixes: github.com/retailcrm/messenger
local-prefixes: github.com/retailcrm/mg-transport-core
lll:
line-length: 120
maligned:
suggest-new: true
misspell:
locale: US
nestif:
min-complexity: 4
min-complexity: 6
whitespace:
multi-if: false
multi-func: false
@ -157,8 +153,8 @@ issues:
exclude-rules:
- path: _test\.go
linters:
- gomnd
- lll
- errorlint
- bodyclose
- errcheck
- sqlclosecheck
@ -166,7 +162,6 @@ issues:
- ineffassign
- whitespace
- makezero
- maligned
- ifshort
- errcheck
- funlen
@ -174,6 +169,9 @@ issues:
- gocognit
- gocyclo
- godot
- unused
- 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