From 28cff347aba050c9e2e5ef585c61d4f4731e362e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B8=D0=BD=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA=20?= =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=B8=D1=87?= Date: Tue, 1 Apr 2025 15:54:50 +0300 Subject: [PATCH] MSP-5186 Update lint --- .golangci.yml | 7 ++----- service/access_list.go | 2 +- service/application.go | 2 +- service/service.go | 2 +- service/token.go | 6 +++--- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d594308..a740dc8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,26 +13,23 @@ linters: disable: - goimports #у нас собственные правила форматирования импортов - wsl #расставление пробелов очень индивидуально - - exhaustivestruct #не имеет смысла - varnamelen #очень индивидуально (db) - exhaustruct #не имеет смысла - - golint #устарел - contextcheck #не имеет смысла - gci #у нас собственные правила форматирования импортов - gofumpt #у нас собственные правила форматирования импортов - nolintlint #Goland все равно форматирует с отступом - nlreturn #не всегда имеет смысл - godot #не актуально для свагера - - ifshort #приняли решение, что мы так не пишем if err := ...; err != nil {} - godox #не позволяет оставлять todo - - maligned #аллокацией памяти для структур конфликтует с удобством их чтения - - nosnakecase #не позволяет заводить пакеты используя snake_case - depguard #не всегда имеет смысл - dupword #не имеет смысла - tagalign #не всегда имеет смысл - musttag #у нас собственные правило: не используем теги, если работаем с пакетом isp-kit/json и с внутренними структурами(между нашими сервисами), при этом теги обязательный для всех внених для нас структур - perfsprint #мнимая производительность в угоду читаемости - gomnd #устарел + - exportloopref #устарел + - execinquery #устарел linters-settings: funlen: lines: 80 diff --git a/service/access_list.go b/service/access_list.go index 103f343..82f54a1 100644 --- a/service/access_list.go +++ b/service/access_list.go @@ -12,7 +12,7 @@ type IAccessListAccessListRep interface { GetAccessListByAppId(ctx context.Context, appId int) ([]entity.AccessList, error) } -type IAccessListApplicationRep interface { +type IAccessListApplicationRep interface { // nolint:iface GetApplicationById(ctx context.Context, id int) (*entity.Application, error) } diff --git a/service/application.go b/service/application.go index 24c94f5..5849b81 100644 --- a/service/application.go +++ b/service/application.go @@ -17,7 +17,7 @@ type IApplicationApplicationRep interface { UpdateApplication(ctx context.Context, id int, name string, description string) (*entity.Application, error) } -type IApplicationTokenRep interface { +type IApplicationTokenRep interface { // nolint:iface GetTokenByAppIdList(ctx context.Context, appIdList []int) ([]entity.Token, error) } diff --git a/service/service.go b/service/service.go index 58d7d3b..3b11fe3 100644 --- a/service/service.go +++ b/service/service.go @@ -18,7 +18,7 @@ type IServiceServiceRep interface { DeleteService(ctx context.Context, idList []int) (int, error) } -type IServiceDomainRep interface { +type IServiceDomainRep interface { // nolint:iface GetDomainById(ctx context.Context, id int) (*entity.Domain, error) } diff --git a/service/token.go b/service/token.go index b03b02d..89c3ed2 100644 --- a/service/token.go +++ b/service/token.go @@ -16,7 +16,7 @@ type ITokenAppEnrich interface { EnrichWithTokens(ctx context.Context, apps []entity.Application) ([]*domain.ApplicationWithTokens, error) } -type ITokenApplicationRep interface { +type ITokenApplicationRep interface { // nolint:iface GetApplicationById(ctx context.Context, id int) (*entity.Application, error) } @@ -24,11 +24,11 @@ type ITokenServiceRep interface { GetServiceById(ctx context.Context, id int) (*entity.Service, error) } -type ITokenDomainRep interface { +type ITokenDomainRep interface { // nolint:iface GetDomainById(ctx context.Context, id int) (*entity.Domain, error) } -type ITokenTokenRep interface { +type ITokenTokenRep interface { // nolint:iface GetTokenByAppIdList(ctx context.Context, appIdList []int) ([]entity.Token, error) }