Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteKey ¶
DeleteKey deletes the specified key from the AST associated with the given field. If pass.Fix is false, then this is a no-op.
func VisitFields ¶
VisitFields can be used to iterate over non-flat fields. Use this when you need to analyze attributes of non-leaf fields.
Types ¶
type Diagnostic ¶
type Diagnostic struct { Pos Pos Category string Message string Related []RelatedInformation `json:"Related,omitempty"` }
type Pass ¶
type Pass struct { Analyzer *Analyzer Fix bool // Should the analyzer apply fixes to AST? // Field information. Fields []*fleetpkg.Field // Fields from every file. Flat []*fleetpkg.Field // Flat view of all fields sorted by file and line number. // Map of file paths to the AST of that file. This is available when Fix is true. // Analyzers may add, modify, and delete map attributes, but they should not // add or remove entire field list entries (any operation that changes indices // in YAML paths would break other analyzers). AST map[string]*AST // ResultOf provides the inputs to this analysis pass, which are // the corresponding results of its prerequisite analyzers. // The map keys are the elements of Analysis.Required, // and the type of each corresponding value is the required // analysis's ResultType. ResultOf map[*Analyzer]interface{} Report func(Diagnostic) }
type Pos ¶
func (Pos) MarshalJSON ¶
type Printer ¶
type Printer func(diags []Diagnostic, w io.Writer)
type RelatedInformation ¶
Directories
¶
Path | Synopsis |
---|---|
Package fieldgroup performs analysis of field groups to ensure they contain a valid 'type'.
|
Package fieldgroup performs analysis of field groups to ensure they contain a valid 'type'. |
Package objectmapping performs analysis of fields to ensure they provide a specific mapping for all fields.
|
Package objectmapping performs analysis of fields to ensure they provide a specific mapping for all fields. |
Click to show internal directories.
Click to hide internal directories.