plugin

package module
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

zerolint golangci Plugin

Go Reference Test License

Usage

Add a file .custom-gcl.yaml to your source with

---
version: v2.2.1
plugins:
  - module: fillmore-labs.com/zerolint-golangci-plugin
    version: v0.0.12

then run golangci-lint custom. You get an custom-gcl executable that can be configured in .golangci.yaml:

---
version: "2"
linters:
  enable:
    - zerolint
  settings:
    custom:
      zerolint:
        type: module
        description: "zerolint checks usage patterns of pointers to zero-size types."
        original-url: "https://fillmore-labs.com/zerolint"
        settings:
          level: "full"
          excluded:
            - "struct{}"
          generated: true
          match: "^your\\.domain/package/path"

and can be used like golangci-lint:

./custom-gcl run .

See also the golangci-lint module plugin system documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(settings any) (register.LinterPlugin, error)

New creates a new Plugin instance with the given Settings.

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is a zerolint linter as a register.LinterPlugin.

func (Plugin) BuildAnalyzers

func (p Plugin) BuildAnalyzers() ([]*analysis.Analyzer, error)

BuildAnalyzers returns the [analysis.Analyzer]s for a zerolint run.

func (Plugin) GetLoadMode

func (Plugin) GetLoadMode() string

GetLoadMode returns the golangci load mode.

type Settings

type Settings struct {
	Excluded  []string        `json:"excluded,omitempty"`
	Level     level.LintLevel `json:"level,omitempty"`
	Match     *regexp.Regexp  `json:"match,omitempty"`
	Generated bool            `json:"generated,omitempty"`
}

Settings are the linters settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL