File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,13 @@ type baseRule struct {
17
17
path * regexp.Regexp
18
18
pathExcept * regexp.Regexp
19
19
linters []string
20
-
21
- // For compatibility with exclude-use-default/include.
22
- internalReference string `mapstructure:"-"`
23
20
}
24
21
25
22
// The usage of `regexp.MustCompile()` is safe here,
26
23
// because the regular expressions are checked before inside [config.BaseRule.Validate].
27
24
func newBaseRule (rule * config.BaseRule , prefix string ) baseRule {
28
25
base := baseRule {
29
- linters : rule .Linters ,
30
- internalReference : rule .InternalReference ,
26
+ linters : rule .Linters ,
31
27
}
32
28
33
29
if rule .Text != "" {
Original file line number Diff line number Diff line change @@ -109,10 +109,16 @@ func (p *ExclusionRules) Finish() {
109
109
110
110
type excludeRule struct {
111
111
baseRule
112
+
113
+ // For compatibility with exclude-use-default/include.
114
+ internalReference string `mapstructure:"-"`
112
115
}
113
116
114
117
func newExcludeRule (rule * config.ExcludeRule , prefix string ) excludeRule {
115
- return excludeRule {baseRule : newBaseRule (& rule .BaseRule , prefix )}
118
+ return excludeRule {
119
+ baseRule : newBaseRule (& rule .BaseRule , prefix ),
120
+ internalReference : rule .InternalReference ,
121
+ }
116
122
}
117
123
118
124
func (e excludeRule ) String () string {
You can’t perform that action at this time.
0 commit comments