Skip to content

Commit 5994389

Browse files
committed
fix: wire nilaway as a golangci-lint module plugin
nilaway is not bundled in golangci-lint v2.x due to false-positive risk (see uber-go/nilaway#4045). Use the module plugin system instead: - Add .custom-gcl.yml with the plugin definition (go.uber.org/nilaway) - Configure nilaway as a custom linter in .golangci.yaml with include-pkgs scoped to this module
1 parent 491ec1e commit 5994389

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.custom-gcl.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# golangci-lint >= v1.57.0 is required for module plugin support.
2+
version: v1.57.0
3+
plugins:
4+
- module: "go.uber.org/nilaway"
5+
import: "go.uber.org/nilaway/cmd/gclplugin"
6+
version: latest

.golangci.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ linters:
2222
- unconvert
2323
- unparam
2424
- unused
25+
settings:
26+
custom:
27+
nilaway:
28+
type: module
29+
description: Static analysis tool to detect potential nil panics in Go code.
30+
settings:
31+
include-pkgs: "github.com/crowdstrike/falcon-cli"
2532
exclusions:
2633
generated: lax
2734
presets:

0 commit comments

Comments
 (0)