mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
NOISSUE - Update GolangCI linter (#2786)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
This commit is contained in:
@@ -31,10 +31,10 @@ jobs:
|
||||
run: |
|
||||
protolint .
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
- name: Run linters
|
||||
uses: golangci/golangci-lint-action@v7
|
||||
with:
|
||||
version: v1.60.3
|
||||
version: v2.0.2
|
||||
args: --config ./tools/config/.golangci.yaml
|
||||
|
||||
- name: Build all Binaries
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
coverage:
|
||||
ignore:
|
||||
- "tools/*"
|
||||
- "cmd/*"
|
||||
- "coap/*"
|
||||
- "**/mocks*"
|
||||
- "*/mocks/*"
|
||||
- "*/middleware/*"
|
||||
- "pkg/sid/mock.go"
|
||||
- "pkg/tracing/utils.go"
|
||||
- "pkg/prometheus/*"
|
||||
|
||||
+106
-80
@@ -1,103 +1,129 @@
|
||||
# Copyright (c) Abstract Machines
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
version: "2"
|
||||
run:
|
||||
timeout: 10m
|
||||
build-tags:
|
||||
- "nats"
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 100
|
||||
max-same-issues: 100
|
||||
exclude:
|
||||
- "string `Usage:\n` has (\\d+) occurrences, make it a constant"
|
||||
- "string `For example:\n` has (\\d+) occurrences, make it a constant"
|
||||
exclude-rules:
|
||||
- path: cli/commands_test.go
|
||||
linters:
|
||||
- godot
|
||||
|
||||
linters-settings:
|
||||
importas:
|
||||
no-unaliased: true
|
||||
no-extra-aliases: false
|
||||
alias:
|
||||
- pkg: github.com/absmach/callhome/pkg/client
|
||||
alias: chclient
|
||||
- pkg: github.com/absmach/supermq/logger
|
||||
alias: smqlog
|
||||
- pkg: github.com/absmach/supermq/pkg/errors/service
|
||||
alias: svcerr
|
||||
- pkg: github.com/absmach/supermq/pkg/errors/repository
|
||||
alias: repoerr
|
||||
- pkg: github.com/absmach/supermq/pkg/sdk/mocks
|
||||
alias: sdkmocks
|
||||
- pkg: github.com/absmach/supermq/api/http/util
|
||||
alias: apiutil
|
||||
- pkg: github.com/absmach/supermq/api/http
|
||||
alias: api
|
||||
gocritic:
|
||||
enabled-checks:
|
||||
- importShadow
|
||||
- httpNoBody
|
||||
- paramTypeCombine
|
||||
- emptyStringTest
|
||||
- builtinShadow
|
||||
- exposedSyncMutex
|
||||
disabled-checks:
|
||||
- appendAssign
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
disabled-tags:
|
||||
- performance
|
||||
- style
|
||||
- experimental
|
||||
- opinionated
|
||||
misspell:
|
||||
ignore-words:
|
||||
- "mosquitto"
|
||||
stylecheck:
|
||||
checks: ["-ST1000", "-ST1003", "-ST1020", "-ST1021", "-ST1022"]
|
||||
goheader:
|
||||
template: |-
|
||||
Copyright (c) Abstract Machines
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
- nats
|
||||
linters:
|
||||
disable-all: true
|
||||
default: none
|
||||
enable:
|
||||
- gocritic
|
||||
- gosimple
|
||||
- errcheck
|
||||
- govet
|
||||
- unused
|
||||
- goconst
|
||||
- godot
|
||||
- godox
|
||||
- ineffassign
|
||||
- misspell
|
||||
- stylecheck
|
||||
- whitespace
|
||||
- gci
|
||||
- gofmt
|
||||
- goimports
|
||||
- loggercheck
|
||||
- goheader
|
||||
- asasalint
|
||||
- asciicheck
|
||||
- bidichk
|
||||
- contextcheck
|
||||
- copyloopvar
|
||||
- decorder
|
||||
- dogsled
|
||||
- dupword
|
||||
- errcheck
|
||||
- errchkjson
|
||||
- errname
|
||||
- copyloopvar
|
||||
- ginkgolinter
|
||||
- gocheckcompilerdirectives
|
||||
- gofumpt
|
||||
- goconst
|
||||
- gocritic
|
||||
- godot
|
||||
- godox
|
||||
- goheader
|
||||
- goprintffuncname
|
||||
- govet
|
||||
- importas
|
||||
- ineffassign
|
||||
- loggercheck
|
||||
- makezero
|
||||
- mirror
|
||||
- misspell
|
||||
- nakedret
|
||||
- dupword
|
||||
- staticcheck
|
||||
- unused
|
||||
- whitespace
|
||||
settings:
|
||||
gocritic:
|
||||
enabled-checks:
|
||||
- importShadow
|
||||
- httpNoBody
|
||||
- paramTypeCombine
|
||||
- emptyStringTest
|
||||
- builtinShadow
|
||||
- exposedSyncMutex
|
||||
disabled-checks:
|
||||
- appendAssign
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
disabled-tags:
|
||||
- performance
|
||||
- style
|
||||
- experimental
|
||||
- opinionated
|
||||
goheader:
|
||||
template: |-
|
||||
Copyright (c) Abstract Machines
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
importas:
|
||||
alias:
|
||||
- pkg: github.com/absmach/callhome/pkg/client
|
||||
alias: chclient
|
||||
- pkg: github.com/absmach/supermq/logger
|
||||
alias: smqlog
|
||||
- pkg: github.com/absmach/supermq/pkg/errors/service
|
||||
alias: svcerr
|
||||
- pkg: github.com/absmach/supermq/pkg/errors/repository
|
||||
alias: repoerr
|
||||
- pkg: github.com/absmach/supermq/pkg/sdk/mocks
|
||||
alias: sdkmocks
|
||||
- pkg: github.com/absmach/supermq/api/http/util
|
||||
alias: apiutil
|
||||
- pkg: github.com/absmach/supermq/api/http
|
||||
alias: api
|
||||
no-unaliased: true
|
||||
no-extra-aliases: false
|
||||
misspell:
|
||||
ignore-rules:
|
||||
- mosquitto
|
||||
staticcheck:
|
||||
checks:
|
||||
- -ST1000
|
||||
- -ST1003
|
||||
- -ST1020
|
||||
- -ST1021
|
||||
- -ST1022
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
rules:
|
||||
- linters:
|
||||
- godot
|
||||
path: cli/commands_test.go
|
||||
- path: (.+)\.go$
|
||||
text: |-
|
||||
string `Usage:
|
||||
` has (\d+) occurrences, make it a constant
|
||||
- path: (.+)\.go$
|
||||
text: |-
|
||||
string `For example:
|
||||
` has (\d+) occurrences, make it a constant
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
issues:
|
||||
max-issues-per-linter: 100
|
||||
max-same-issues: 100
|
||||
formatters:
|
||||
enable:
|
||||
- gci
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- goimports
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
||||
Reference in New Issue
Block a user