Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BlacklistRule = Rule{ Name: "blacklist", Terms: []string{"blacklist", "black-list", "blacklisted", "black-listed"}, Alternatives: []string{"denylist", "blocklist"}, Severity: 1, }
BlacklistRule is the default rule for "blacklist"
var DefaultRules = []*Rule{ &BlacklistRule, &DummyRule, &GrandfatheredRule, &GuysRule, &HeRule, &ManHoursRule, &MasterSlaveRule, &SanityRule, &SlaveRule, &WhitelistRule, }
DefaultRules are the default rules always used
var DummyRule = Rule{ Name: "dummy", Terms: []string{"dummy"}, Alternatives: []string{"placeholder", "sample"}, }
DummyRule is the default rule for "dummy"
var GrandfatheredRule = Rule{ Name: "grandfathered", Terms: []string{"grandfathered"}, Alternatives: []string{"legacy status"}, }
GrandfatheredRule is the default rule for "grandfathered"
var GuysRule = Rule{ Name: "guys", Terms: []string{"guys"}, Alternatives: []string{"folks", "people", "you all", "y'all"}, }
GuysRule is the default rule for "guys"
var HeRule = Rule{ Name: "he", Terms: []string{"he", "his", "him"}, Alternatives: []string{"they", "them", "their"}, }
HeRule is the default rule for "he"
var ManHoursRule = Rule{ Name: "man-hours", Terms: []string{"man hours", "man-hours"}, Alternatives: []string{"person hours", "engineer hours"}, }
ManHoursRule is the default rule for "man-hours"
var MasterSlaveRule = Rule{ Name: "master-slave", Terms: []string{"master-slave", "master/slave"}, Alternatives: []string{"leader/follower", "primary/replica", "primary/standby"}, }
MasterSlaveRule is the default rule for "master-slave"
var SanityRule = Rule{ Name: "sanity", Terms: []string{"sanity"}, Alternatives: []string{"confidence", "quick check", "coherence check"}, }
SanityRule is the default rule for "sanity"
var SlaveRule = Rule{ Name: "slave", Terms: []string{"slave"}, Alternatives: []string{"follower", "replica", "standby"}, }
SlaveRule is the default rule for "slave"
var WhitelistRule = Rule{ Name: "whitelist", Terms: []string{"whitelist", "white-list", "whitelisted", "white-listed"}, Alternatives: []string{"allowlist"}, Severity: 1, }
WhitelistRule is the default rule for "whitelist"
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule struct { Name string `yaml:"name"` Terms []string `yaml:"terms"` Alternatives []string `yaml:"alternatives"` Note string `yaml:"note"` Severity Severity `yaml:"severity"` // contains filtered or unexported fields }
Rule is a linter rule
func (*Rule) CanIgnoreLine ¶ added in v0.1.4
CanIgnoreLine returns a boolean value if the line contains the ignore directive. For example, if a line has anywhere, `woke:disable=whitelist` (should be commented out via whatever the language comment syntax is) it will not report that line in violation with the Rule with the name `whitelist`
func (*Rule) FindAllStringIndex ¶
func (*Rule) ReasonWithNote ¶
ReasonWithNote returns a human-readable reason for the rule violation with an additional note, if defined.
type Severity ¶
type Severity int
Severity is a log severity
func (*Severity) UnmarshalYAML ¶
UnmarshalYAML to unmarshal severity string