suppress

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasInlineIgnore

func HasInlineIgnore(line string) bool

HasInlineIgnore returns true if the line contains a pgspectre:ignore comment.

Types

type IgnoreFile

type IgnoreFile struct {
	Suppressions []Suppression `yaml:"suppressions"`
}

IgnoreFile is the structure of .pgspectre-ignore.yml.

type Rules

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

Rules holds loaded suppression rules from all sources.

func LoadRules

func LoadRules(dir string) (*Rules, error)

LoadRules loads suppression rules from .pgspectre-ignore.yml in the given directory.

func (*Rules) Filter

func (r *Rules) Filter(findings []analyzer.Finding) ([]analyzer.Finding, int)

Filter removes suppressed findings and returns the remaining ones. Returns the filtered list and the number of suppressed findings.

func (*Rules) IsSuppressed

func (r *Rules) IsSuppressed(f *analyzer.Finding) bool

IsSuppressed returns true if the finding should be suppressed.

func (*Rules) WithConfigFindings

func (r *Rules) WithConfigFindings(findings []string)

WithConfigFindings adds finding-type suppressions from config.

type Suppression

type Suppression struct {
	Table  string `yaml:"table"`
	Type   string `yaml:"type,omitempty"`
	Reason string `yaml:"reason,omitempty"`
}

Suppression is a single rule in the ignore file.

Jump to

Keyboard shortcuts

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