lints

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PerformLinting

func PerformLinting(repoDir string, pkg *g2.PackageData) []string

func RegisterLintRule

func RegisterLintRule(rule LintRule)

func RegisterRuleMetadata added in v0.0.34

func RegisterRuleMetadata(meta RuleMetadata)

Types

type LintResult added in v0.0.34

type LintResult struct {
	RuleMetadata RuleMetadata `json:"rule"`
	Message      string       `json:"message"`
	Package      string       `json:"package,omitempty"`
	File         string       `json:"file,omitempty"`
	Line         int          `json:"line,omitempty"`
}

func PerformLintingResults added in v0.0.34

func PerformLintingResults(repoDir string, pkg *g2.PackageData) []LintResult

func (LintResult) String added in v0.0.34

func (lr LintResult) String() string

type LintRule

type LintRule interface {
	Lint(repoDir string, pkg *g2.PackageData) []LintResult
}

type MetadataAwareLintRule added in v0.0.34

type MetadataAwareLintRule interface {
	LintRule
	Metadata() RuleMetadata
}

type QAAwareLintRule

type QAAwareLintRule interface {
	LintWithQA(repoDir string, pkg *g2.PackageData, qa *g2.QAPolicy) []LintResult
}

type RuleMetadata added in v0.0.34

type RuleMetadata struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	URL         string   `json:"url,omitempty"`
	Severity    Severity `json:"severity"`
	Source      Source   `json:"source"`
	Tags        []string `json:"tags,omitempty"`
}

func GetAllRules added in v0.0.34

func GetAllRules() []RuleMetadata

type Severity added in v0.0.34

type Severity string
const (
	SeverityError   Severity = "Error"
	SeverityWarning Severity = "Warning"
	SeverityNotice  Severity = "Notice"
	SeverityInfo    Severity = "Info"
)

type Source added in v0.0.34

type Source string
const (
	SourceG2       Source = "g2"
	SourcePkgcheck Source = "pkgcheck"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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