Documentation ¶
Overview ¶
Package lint contains core functionality used by Folx to check a text for compliance to a style guide.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FolxLinter ¶
FolxLinter implements Linter.
func NewInitialisedFolxLinter ¶
func NewInitialisedFolxLinter(ruleBook rule.Book) (linter *FolxLinter, err error)
NewInitialisedFolxLinter is a helper factory that returns a fully initialised linter ready for Lint().
type Report ¶
type Report struct { ParentGUID string GUID string CreateTime time.Time LexerExec time.Duration LinterExec time.Duration StyleGuideName string SourceName string TokenCount int RuleCount int FailedRules int FailedRulesPct float64 PassedRules int PassedRulesPct float64 RunCount int FailedRuns int FailedRunsPct float64 PassedRuns int PassedRunsPct float64 FailResults []Result }
Report is a description of the results of the linting process.
func NewReport ¶
func NewReport() Report
NewReport is factory that creates a new report with initialised GUID
func (*Report) UpdateStats ¶
UpdateStats recalculates report stats based on the given failedRuleCount, and the lenth of the FailResults slice
func (*Report) WriteResultToCSV ¶
WriteResultToCSV writes a CSV representation of the fail results array to an IO stream.
type ReportSet ¶
ReportSet is a set of reports that share a ParentGUID
func NewReportSet ¶
func NewReportSet() ReportSet
NewReportSet is factory that creates a new report with initialised GUID