Documentation
¶
Index ¶
- 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)
- 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 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 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.
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 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.
Click to show internal directories.
Click to hide internal directories.