Documentation
¶
Index ¶
- func ClearRepoContext(key string)
- func PerformLinting(repoDir string, pkg *g2.PackageData) []string
- func PerformLintingWithRuleSet(repoDir string, pkg *g2.PackageData, ruleSetID string) ([]string, error)
- func RegisterEclassLintRule(rule EclassLintRule)
- func RegisterLintRule(rule LintRule)
- func RegisterRepoLintRule(rule RepoLintRule)
- func RegisterRuleMetadata(meta RuleMetadata)
- func RegisterRuleSet(rs *RuleSet)
- func SetRepoContext(key string, ctx *RepoLintContext)
- type EclassLintRule
- type LintResult
- func PerformEclassLintingResults(repoDir string, eclass *g2.Ebuild) []LintResult
- func PerformLintingResults(repoDir string, pkg *g2.PackageData) []LintResult
- func PerformLintingResultsWithRuleSet(repoDir string, pkg *g2.PackageData, ruleSetID string) ([]LintResult, error)
- func PerformRepoLintingResults(repoDir string, site *g2.SiteData) []LintResult
- type LintRule
- type MetadataAwareLintRule
- type QAAwareEclassLintRule
- type QAAwareLintRule
- type RepoLintContext
- type RepoLintRule
- type RuleMetadata
- type RuleReference
- type RuleSet
- type RuleSetEntry
- type RuleSetManagedLintRule
- type Severity
- type Source
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 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 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 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
GetRuleSet retrieves a RuleSet by its ID.
type RuleSetEntry ¶ added in v0.0.98
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.