From 646ba527744da217c38f75cd8d9ea3b40b0b5557 Mon Sep 17 00:00:00 2001 From: size12 Date: Thu, 25 Jan 2024 20:33:21 +0300 Subject: [PATCH 1/2] test --- .golangci.yml | 7 +++++-- internal/table/client_test.go | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e58998c24..83fa0898d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -217,7 +217,6 @@ linters: - exhaustive - exhaustivestruct - exhaustruct - - forbidigo - forcetypeassert - funlen - gci @@ -306,4 +305,8 @@ issues: # Examples: Type_PRIMITIVE_TYPE_ID_UNSPECIFIED, Ydb_Discovery_V1, _voidValue - linters: - nosnakecase - text : "(?:_[a-z]+(?:[A-Z](?:[a-z\\d]+|[A-Z\\d]+))+|(?:[A-Z][a-z\\d]+|[A-Z][A-Z\\d]+)+_(?:(?:[A-Z][a-z\\d]+|[A-Z\\d][A-Z\\d]+)_?)+)" \ No newline at end of file + text : "(?:_[a-z]+(?:[A-Z](?:[a-z\\d]+|[A-Z\\d]+))+|(?:[A-Z][a-z\\d]+|[A-Z][A-Z\\d]+)+_(?:(?:[A-Z][a-z\\d]+|[A-Z\\d][A-Z\\d]+)_?)+)" + + - path: ../examples + linters: + - forbidigo \ No newline at end of file diff --git a/internal/table/client_test.go b/internal/table/client_test.go index 90937d41c..24ecee219 100644 --- a/internal/table/client_test.go +++ b/internal/table/client_test.go @@ -893,6 +893,7 @@ func (s *StubBuilder) createSession(ctx context.Context) (session *session, err return newSession(ctx, s.cc, config.New()) } +//nolint:forbidigo func (c *Client) debug() { fmt.Print("head ") for el := c.idle.Front(); el != nil; el = el.Next() { From 32533c3da2dfb756514df9c9b5764d6c060493be Mon Sep 17 00:00:00 2001 From: size12 Date: Thu, 25 Jan 2024 21:35:21 +0300 Subject: [PATCH 2/2] solution --- .github/workflows/lint.yml | 4 ++++ .golangci.yml | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d62b7849e..e24f8cae0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,8 @@ jobs: - uses: actions/checkout@v3 - name: generate examples golangci-lint config run: sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/examples/g' .golangci.yml > examples/.golangci.yml + - name: disable specified linter in examples folder + run: sed -i 's/#disable:examples//g' examples/.golangci.yml - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: @@ -48,6 +50,8 @@ jobs: - uses: actions/checkout@v3 - name: generate slo golangci-lint config run: sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/slo/g' .golangci.yml > tests/slo/.golangci.yml + - name: disable specified linter in slo folder + run: sed -i 's/#disable:slo//g' tests/slo/.golangci.yml - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.golangci.yml b/.golangci.yml index 83fa0898d..547762947 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -246,6 +246,8 @@ linters: - varnamelen - wrapcheck - wsl +#disable:examples - forbidigo +#disable:slo - forbidigo issues: # List of regexps of issue texts to exclude, empty list by default. @@ -305,8 +307,4 @@ issues: # Examples: Type_PRIMITIVE_TYPE_ID_UNSPECIFIED, Ydb_Discovery_V1, _voidValue - linters: - nosnakecase - text : "(?:_[a-z]+(?:[A-Z](?:[a-z\\d]+|[A-Z\\d]+))+|(?:[A-Z][a-z\\d]+|[A-Z][A-Z\\d]+)+_(?:(?:[A-Z][a-z\\d]+|[A-Z\\d][A-Z\\d]+)_?)+)" - - - path: ../examples - linters: - - forbidigo \ No newline at end of file + text : "(?:_[a-z]+(?:[A-Z](?:[a-z\\d]+|[A-Z\\d]+))+|(?:[A-Z][a-z\\d]+|[A-Z][A-Z\\d]+)+_(?:(?:[A-Z][a-z\\d]+|[A-Z\\d][A-Z\\d]+)_?)+)" \ No newline at end of file