Documentation ¶
Overview ¶
Package model describes basic linter entities.
Index ¶
Constants ¶
View Source
const SuffixRecursive = "..."
SuffixRecursive is a path suffix which enables recursive directories discovering.
Variables ¶
This section is empty.
Functions ¶
func NewErrorSet ¶
NewErrorSet creates error that handles many errors. It skips all nil errors.
func NewImportOrderError ¶
NewImportOrderError creates new error about invalid import order.
Types ¶
type Node ¶
type Node struct { Kind NodeKind Position token.Position Value string // Offset out of comments. Offset int }
Node describes a unit from the program.
func NewCommentNode ¶
NewCommentNode creates new Node for comment entity.
func NewImportNode ¶
NewImportNode creates new Node for import entity.
type NodeKind ¶
type NodeKind uint8
NodeKind describes a type of the node.
const ( // KindUnknown is a undeterminated kind. KindUnknown NodeKind = iota // KindImportSTD is a standart library import kind. KindImportSTD // KindImportInternal is a current package import kind. KindImportInternal // KindImportVendor is a external package import kind. KindImportVendor // KindComment is a regular comment kind. KindComment // KindImportUnused is an unused package. For example SQL driver. KindImportUnused // KindImportC is a "C" package. // More details: https://pkg.go.dev/cmd/cgo. KindImportC )
Possible node Kinds.
type Reason ¶
type Reason string
Reason of an error.
const ( ReasonUnknown Reason = "" ReasonExtraLine Reason = "extra line before" ReasonMissingLine Reason = "missing line after" ReasonTooManyLines Reason = "too many lines after" )
Possible reasons
func ReasonFromError ¶
ReasonFromError extracts reason from the error.
Click to show internal directories.
Click to hide internal directories.