Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TypeIsCompatible ¶ added in v0.3.0
TypesIsCompatible reports whether val type is compatible with dst type.
Types ¶
type Rule ¶
type Rule struct { // Name tells whether this rule causes critical report. Name string // Link to the documentation about rule Link string // Matcher is an object that is used to check whether a given AST node // should trigger a warning that is associated with rule. Matcher *phpgrep.Matcher // Level is a severity level that is used during report generation. Level int // StrictSyntax determines whether phpgrep fuzzy search should not be used. StrictSyntax bool // Message is a report text that is printed when this rule matches. Message string // Fix is a quickfix template. Fix string // Location is a phpgrep variable name that should be used as a warning location. // WithDeprecationNote string selects the root node. Location string // Path is a filter-like rule switcher. // A rule is only applied to a file that contains a Path as a substring in its name. Paths []string // PathExcludes is a filter-like rule switcher. // A rule is not applied to a file that contains a PathExcludes as a substring in its name. PathExcludes map[string]bool // Filters is a list of OR-connected filter sets. // Every filter set is a mapping of phpgrep variable to a filter. Filters []map[string]Filter // contains filtered or unexported fields }
Rule is a dynamically-loaded linter rule.
A rule is called unnamed if no @name attribute is given. Unnamed rules receive auto-generated name that includes a rule file name and a line that defines that rule.
type ScopedSet ¶
ScopedSet is a categorized rules collection. Categories help to assign a better execution strategy for a rule.
type Set ¶
type Set struct { Any *ScopedSet // Anywhere Root *ScopedSet // Only outside of functions Local *ScopedSet // Only inside functions Builtin bool // Whether this is a NoVerify builtin rule set Names []string // All rule names DocByName map[string]RuleDoc }
Set is a result of rule file parsing.
Click to show internal directories.
Click to hide internal directories.