From eef54f415305a162ffc871c99fa91fcefcd61964 Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:54:30 -0300 Subject: [PATCH] chore(golangci-lint): add forward-looking static checking rules BE-12183 (#1200) --- .golangci-forward.yaml | 11 +++++++++++ Makefile | 1 + 2 files changed, 12 insertions(+) create mode 100644 .golangci-forward.yaml diff --git a/.golangci-forward.yaml b/.golangci-forward.yaml new file mode 100644 index 000000000..b3bee5422 --- /dev/null +++ b/.golangci-forward.yaml @@ -0,0 +1,11 @@ +version: "2" +linters: + default: none + enable: + - forbidigo + settings: + forbidigo: + forbid: + - pattern: ^dataservices.DataStore.(EdgeGroup|EdgeJob|EdgeStack|EndpointRelation|Endpoint|GitCredential|Registry|ResourceControl|Role|Settings|Snapshot|Stack|Tag|User)$ + msg: Use a transaction instead + analyze-types: true diff --git a/Makefile b/Makefile index e264c357f..f69c3b63c 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,7 @@ lint-client: ## Lint client code lint-server: tidy ## Lint server code golangci-lint run --timeout=10m -c .golangci.yaml + golangci-lint run --timeout=10m --new-from-rev=HEAD~ -c .golangci-forward.yaml ##@ Extension .PHONY: dev-extension