From d21748990fcb819b0c263f2e40be31490255a37b Mon Sep 17 00:00:00 2001 From: skyflow-himanshu Date: Fri, 16 Jan 2026 12:23:20 +0530 Subject: [PATCH 1/3] SK-2464: add linter to GO sdk v2 --- .github/workflows/ci.yml | 7 +++++++ v2/.golangci.yml | 37 +++++++++++++++++++++++++++++++++++++ v2/utils/common/common.go | 3 +++ 3 files changed, 47 insertions(+) create mode 100644 v2/.golangci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1459ef..8a5349c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,13 @@ jobs: with: go-version: 1.21 + - name: Run golangci-lint for v2 + uses: golangci/golangci-lint-action@v9 + with: + version: v2.8.0 + working-directory: v2 + args: --config=v2/.golangci.yml --timeout=5m + - name: create-json id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/v2/.golangci.yml b/v2/.golangci.yml new file mode 100644 index 0000000..9961087 --- /dev/null +++ b/v2/.golangci.yml @@ -0,0 +1,37 @@ +version: "2" + +run: + timeout: 5m + tests: false + relative-path-mode: gomod + +linters: + default: none + enable: + - revive + exclusions: + paths: + - internal/generated + - test + + settings: + revive: + enable-all-rules: false + enable-default-rules: false + rules: + - name: var-naming + arguments: + - ["ID", "URL", "API", "HTTP", "JSON", "UUID"] + - [] + - - upper-case-const: true + skip-package-name-checks: true + - name: receiver-naming + + - name: exported + disabled: true + - name: package-comments + disabled: true + - name: dot-imports + disabled: true + - name: indent-error-flow + disabled: true \ No newline at end of file diff --git a/v2/utils/common/common.go b/v2/utils/common/common.go index ee3800d..21ed51e 100644 --- a/v2/utils/common/common.go +++ b/v2/utils/common/common.go @@ -99,6 +99,7 @@ const ( Gender DetectEntities = "gender" HealthcareNumber DetectEntities = "healthcare_number" Injury DetectEntities = "injury" + //revive:disable-next-line:var-naming IpAddress DetectEntities = "ip_address" Language DetectEntities = "language" Location DetectEntities = "location" @@ -423,11 +424,13 @@ type DetokenizeResponse struct { type DeleteRequest struct { Table string + //revive:disable-next-line:var-naming Ids []string } type DeleteResponse struct { // Response fields + //revive:disable-next-line:var-naming DeletedIds []string Errors []map[string]interface{} } From 23332094c6b417a63a6993a9024bf640f627b8ce Mon Sep 17 00:00:00 2001 From: skyflow-himanshu Date: Fri, 16 Jan 2026 12:36:29 +0530 Subject: [PATCH 2/3] SK-2464: fix configuration for linter failing in ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a5349c..681c87c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: with: version: v2.8.0 working-directory: v2 - args: --config=v2/.golangci.yml --timeout=5m + args: --config=.golangci.yml --timeout=5m - name: create-json id: create-json From 2d201e23a4622ba4be1945732eadc830cfb887a2 Mon Sep 17 00:00:00 2001 From: skyflow-himanshu Date: Fri, 16 Jan 2026 12:40:55 +0530 Subject: [PATCH 3/3] SK-2464: fix linter var-naming failing in ci --- v2/utils/common/common.go | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/utils/common/common.go b/v2/utils/common/common.go index 21ed51e..38d1485 100644 --- a/v2/utils/common/common.go +++ b/v2/utils/common/common.go @@ -452,6 +452,7 @@ type UpdateResponse struct { type GetRequest struct { Table string + //revive:disable-next-line:var-naming Ids []string } type GetOptions struct {