-
Notifications
You must be signed in to change notification settings - Fork 1
/
option.go
37 lines (30 loc) · 891 Bytes
/
option.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package pepperlint
import (
"go/token"
)
// Option will allow rules to be prepped with defined visitor
// Rules or caching can be initialized during the 'With' call of
// the option
type Option interface{}
// Rule is an empty interface but will allow for modifications later
// if this needs to be a more specific type.
type Rule interface{}
// RulesAdder will add rules to sets of rules
type RulesAdder interface {
AddRules(*Rules)
}
// CacheOption will allow rules to perform action based on what is
// in the cache.
type CacheOption interface {
WithCache(*Cache)
}
// FileSetOption will set the token.FileSet to a given
// rule.
type FileSetOption interface {
WithFileSet(*token.FileSet)
}
// CopyRuler is used to copy a pre-existing rule allowing for a new
// rule to be acted upon indenpendently from the rule it is copied from.
type CopyRuler interface {
CopyRule() Rule
}