Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
Systems []CatalogEntry `json:"systems,omitempty"`
Actors []CatalogEntry `json:"actors,omitempty"`
Events []CatalogEntry `json:"events,omitempty"`
States []CatalogEntry `json:"states,omitempty"`
Features []CatalogEntry `json:"features,omitempty"`
Modes []CatalogEntry `json:"modes,omitempty"`
Conditions []CatalogEntry `json:"conditions,omitempty"`
DataTerms []CatalogEntry `json:"dataTerms,omitempty"`
}
type CatalogEntry ¶
type CatalogRef ¶
type ClauseExpr ¶
type ClauseExpr struct {
Kind string `json:"kind"`
Span *Span `json:"span,omitempty"`
Term *TermMatch `json:"term,omitempty"`
Text string `json:"text,omitempty"`
Items []ClauseExpr `json:"items,omitempty"`
Item *ClauseExpr `json:"item,omitempty"`
}
type ClauseType ¶
type ClauseType string
const ( ClauseWhile ClauseType = "while" ClauseWhen ClauseType = "when" ClauseWhere ClauseType = "where" ClauseIf ClauseType = "if" )
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Severity Severity `json:"severity"`
Message string `json:"message"`
Span *Span `json:"span,omitempty"`
}
func LintCatalogCoverage ¶
func LintCatalogCoverage(items [][2]string, catalog Catalog, options *Options) []Diagnostic
LintCatalogCoverage lints catalog-term coverage across a batch of requirements. It emits warning diagnostics for catalog entries that are never referenced by any requirement text. Coverage diagnostics are emitted only in strict mode.
func LintCatalogCoverageFromResults ¶
func LintCatalogCoverageFromResults(results []LintResult, catalog Catalog, options *Options) []Diagnostic
LintCatalogCoverageFromResults lints catalog-term coverage using already computed lint results. Coverage diagnostics are emitted only in strict mode.
type EarsAST ¶
type EarsAST struct {
Pattern Pattern `json:"pattern"`
Preconditions *ClauseExpr `json:"preconditions,omitempty"`
Trigger *ClauseExpr `json:"trigger,omitempty"`
Feature *ClauseExpr `json:"feature,omitempty"`
System TermMatch `json:"system"`
Responses []string `json:"responses"`
Raw string `json:"raw"`
}
type LintResult ¶
type LintResult struct {
ID string `json:"id,omitempty"`
Valid bool `json:"valid"`
Pattern Pattern `json:"pattern,omitempty"`
AST *EarsAST `json:"ast,omitempty"`
References []ReferenceMatch `json:"references"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
func LintEarsBatch ¶
func LintEarsBatch(items [][2]string, catalog Catalog, options *Options) []LintResult
type ReferenceMatch ¶
type ReferenceMatch struct {
Clause string `json:"clause"`
Text string `json:"text"`
Role TermRole `json:"role"`
Matched *CatalogRef `json:"matched,omitempty"`
Ambiguous []CatalogRef `json:"ambiguous,omitempty"`
Unresolved bool `json:"unresolved,omitempty"`
ViaAlias bool `json:"viaAlias,omitempty"`
Span *Span `json:"span,omitempty"`
}
type TermMatch ¶
type TermMatch struct {
Raw string `json:"raw"`
Role TermRole `json:"role"`
Matched *CatalogRef `json:"matched,omitempty"`
Ambiguous []CatalogRef `json:"ambiguous,omitempty"`
Unresolved bool `json:"unresolved,omitempty"`
ViaAlias bool `json:"viaAlias,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.