Skip to content

Commit 024ef4e

Browse files
committed
docs: align plugin.go with kube-api-linter pattern
Reference the KAL plugin pattern and export New at root level for consistency with other golangci-lint module plugins. See: https://github.com/kubernetes-sigs/kube-api-linter/blob/main/plugin.go
1 parent 154dd7b commit 024ef4e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

plugin.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
// Package krtequals provides a golangci-lint plugin for checking Equals() method implementations.
1+
// Package krtequals is a golangci-lint plugin for checking Equals() method implementations.
2+
// It is built as a module to be used with golangci-lint.
3+
// See https://golangci-lint.run/plugins/module-plugins/ for more information.
24
//
3-
// This file exists to satisfy golangci-lint's module plugin system, which expects
4-
// a package at the module root. The actual plugin registration happens in the
5-
// pkg/analyzer package's init() function.
5+
// This pattern follows the same approach used by kube-api-linter (KAL):
6+
// https://github.com/kubernetes-sigs/kube-api-linter/blob/main/plugin.go
67
package krtequals
78

89
import (
9-
// Import the analyzer package to trigger plugin registration via init().
10-
_ "github.com/kgateway-dev/krtequals/pkg/analyzer"
10+
// Importing the analyzer package triggers plugin registration via init().
11+
"github.com/kgateway-dev/krtequals/pkg/analyzer"
1112
)
1213

14+
// New is the entrypoint for the plugin.
15+
var New = analyzer.New

0 commit comments

Comments
 (0)