mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-12 03:39:55 +00:00
[ci] Suppress typecheck on the ui-wails embed instead of skipping main.go
The previous attempt added client/ui-wails/main.go to the file path exclude list, but golangci-lint v2's path filter only suppresses issues from rule-based linters; the typecheck pre-pass that compiles the package still runs and fails with "pattern all:frontend/dist: no matching files found" before any rule fires. Replace the path-level skip with a targeted exclusions.rules entry that matches just that diagnostic on just that file. The rest of client/ui-wails (services/, tray.go, grpc.go, ...) keeps being linted normally. Validated locally by deleting frontend/dist and running `golangci-lint run client/ui-wails/...` — 0 issues with this config.
This commit is contained in:
@@ -114,16 +114,20 @@ linters:
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: "QF1012"
|
||||
# client/ui-wails/main.go uses //go:embed all:frontend/dist; the
|
||||
# directory is populated by `pnpm build` in the release pipeline
|
||||
# and missing at lint time, so the embed parses to "no matching
|
||||
# files found" — surfaced by golangci-lint's typecheck pre-pass.
|
||||
# Suppress just that one diagnostic; the rest of the package
|
||||
# (services/, tray.go, grpc.go, ...) still gets linted normally.
|
||||
- linters:
|
||||
- typecheck
|
||||
path: client/ui-wails/main\.go
|
||||
text: "pattern all:frontend/dist"
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
# client/ui-wails/main.go uses //go:embed all:frontend/dist; that
|
||||
# directory is populated by `pnpm build` in the release pipeline
|
||||
# and is missing at lint time, so the typecheck phase fails before
|
||||
# any rule runs. Skip just main.go — the rest of the package
|
||||
# (services/, tray.go, grpc.go, ...) still gets linted.
|
||||
- client/ui-wails/main\.go$
|
||||
issues:
|
||||
max-same-issues: 5
|
||||
formatters:
|
||||
|
||||
Reference in New Issue
Block a user