lints

package
v0.0.99 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: GPL-2.0 Imports: 5 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 PerformLintingWithRuleSet added in v0.0.98

func PerformLintingWithRuleSet(repoDir string, pkg *g2.PackageData, ruleSetID string) ([]string, error)

func RegisterEclassLintRule added in v0.0.98

func RegisterEclassLintRule(rule EclassLintRule)

func RegisterLintRule

func RegisterLintRule(rule LintRule)

func RegisterRepoLintRule added in v0.0.98

func RegisterRepoLintRule(rule RepoLintRule)

func RegisterRuleMetadata added in v0.0.34

func RegisterRuleMetadata(meta RuleMetadata)

func RegisterRuleSet added in v0.0.98

func RegisterRuleSet(rs *RuleSet)

RegisterRuleSet registers or updates a RuleSet in the central registry.

Types

type EclassLintRule added in v0.0.98

type EclassLintRule interface {
	Lint(repoDir string, eclass *g2.Ebuild) []LintResult
}

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 PerformEclassLintingResults added in v0.0.98

func PerformEclassLintingResults(repoDir string, eclass *g2.Ebuild) []LintResult

func PerformLintingResults added in v0.0.34

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

func PerformLintingResultsWithRuleSet added in v0.0.98

func PerformLintingResultsWithRuleSet(repoDir string, pkg *g2.PackageData, ruleSetID string) ([]LintResult, error)

func PerformRepoLintingResults added in v0.0.98

func PerformRepoLintingResults(repoDir string, site *g2.SiteData) []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 QAAwareEclassLintRule added in v0.0.98

type QAAwareEclassLintRule interface {
	LintWithQA(repoDir string, eclass *g2.Ebuild, qa *g2.QAPolicy) []LintResult
}

type QAAwareLintRule

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

type RepoLintRule added in v0.0.98

type RepoLintRule interface {
	LintRepo(repoDir string, site *g2.SiteData) []LintResult
}

type RuleMetadata added in v0.0.34

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

func GetAllRules added in v0.0.34

func GetAllRules() []RuleMetadata

func (*RuleMetadata) UnmarshalJSON added in v0.0.98

func (r *RuleMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON provides backward-compatible unmarshaling for legacy "url" and "urls" fields.

type RuleReference added in v0.0.98

type RuleReference struct {
	URL   string `json:"url"`
	Label string `json:"label,omitempty"`
}

type RuleSet added in v0.0.98

type RuleSet struct {
	ID          string
	Description string
	Rules       map[string]RuleSetEntry
}

RuleSet defines a named baseline collection of lint rules and their effective severities.

func GetRuleSet added in v0.0.98

func GetRuleSet(id string) (*RuleSet, bool)

GetRuleSet retrieves a RuleSet by its ID.

type RuleSetEntry added in v0.0.98

type RuleSetEntry struct {
	Enabled  bool
	Severity Severity
}

RuleSetEntry defines the enablement and effective severity of a rule within a RuleSet.

type RuleSetManagedLintRule added in v0.0.98

type RuleSetManagedLintRule interface {
	MetadataAwareLintRule
	RuleSetManaged()
}

RuleSetManagedLintRule is an opt-in interface for lint rules whose enablement and effective severity are managed by a RuleSet.

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"
	SourceQA       Source = "qa"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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