From 65cbce43d5ae2541d8046840bff73cd2de5705f6 Mon Sep 17 00:00:00 2001 From: xiongyuanwen-byted Date: Wed, 3 Jun 2026 19:06:56 +0800 Subject: [PATCH] ci(sheets): exempt internal/gen generators from forbidigo The shortcuts/sheets/internal/gen code generator is a standalone `package main` run via go:generate, not shortcut runtime code, so the forbidigo bans on log.Fatal / os.ReadFile / fmt.Printf do not apply. Making it "compliant" is impossible anyway: a structured error return needs os.Exit (also banned), and the vfs alternative is blocked by depguard shortcuts-no-vfs. Exempt shortcut internal/gen paths, matching the existing _test.go and internal/vfs forbidigo exemptions. --- .golangci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 2a16994f5..f268e2af4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -57,6 +57,14 @@ linters: - path: internal/vfs/ linters: - forbidigo + # internal/gen build-time generators (standalone `package main` run via + # go:generate) are not shortcut runtime code — no ctx/runtime/framework — + # so the shortcut forbidigo bans don't apply. Going "compliant" is also + # impossible here: a structured error return needs os.Exit (also banned), + # and the vfs.Xxx() alternative is blocked by depguard shortcuts-no-vfs. + - path: shortcuts/.*/internal/gen/ + linters: + - forbidigo # shortcuts-no-raw-http is shortcuts-only; internal/ wraps raw HTTP # for the client / credential layer. - path-except: shortcuts/