From 668950a8c8145cf75a958d6cc64b902cda947235 Mon Sep 17 00:00:00 2001 From: Anders Eknert Date: Thu, 12 Dec 2024 11:53:06 +0100 Subject: [PATCH] dev: Fix golangci-lint reporting issues in ignored files in VS Code (#1296) Signed-off-by: Anders Eknert --- .golangci.yaml | 9 +++++++++ .vscode/settings.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.golangci.yaml b/.golangci.yaml index b1140df8..7f783c30 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -63,3 +63,12 @@ linters-settings: issues: exclude-dirs: - internal/lsp/opa + exclude-files: + # For whatever reason, the exclude-dirs setting isn't honored when + # golangci-lint is targeting one of these files *specifically* rather + # than whole whole workspace / directory. This happens when opening up + # one of these files in VS Code, which will have the linter complain + # loudly. Hopefully this workaround can be removed in the future. + - oracle.go + - scanner.go + - tokens.go diff --git a/.vscode/settings.json b/.vscode/settings.json index 5b222a2d..33cc1500 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,6 @@ "opa.roots": [ "${workspaceFolder}/bundle" ], - "opa.strictMode": true + "opa.strictMode": true, + "go.lintTool": "golangci-lint" }