lints

package
v0.0.108 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: GPL-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearRepoContext added in v0.0.105

func ClearRepoContext(key string)

ClearRepoContext removes a registered RepoLintContext for the given key.

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.

func SetRepoContext added in v0.0.105

func SetRepoContext(key string, ctx *RepoLintContext)

SetRepoContext registers a RepoLintContext for the given key.

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 RepoLintContext added in v0.0.105

type RepoLintContext struct {
	FS             fs.FS
	RepoDirInFS    string
	QAPolicy       *g2.QAPolicy
	LayoutConf     *g2.LayoutConf
	UseExpandDescs map[string]*g2.UseExpandDesc
	ArchList       *g2.ArchList
	HasRepoName    bool
	HasMD5CacheDir bool
	// contains filtered or unexported fields
}

RepoLintContext holds pre-parsed repository-level metadata and virtual filesystem references to avoid redundant disk reads during per-package linting.

func GetRepoContext added in v0.0.105

func GetRepoContext(key string) *RepoLintContext

GetRepoContext retrieves a registered RepoLintContext for the given key, or nil if none is registered.

func (*RepoLintContext) HashEclass added in v0.0.105

func (c *RepoLintContext) HashEclass(eclassPath string) (string, error)

HashEclass computes and caches the MD5 hash of an eclass from the RepoLintContext's FS.

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