@@ -116,42 +116,41 @@ func (r *FileReader) parseConfig() error {
116
116
}
117
117
118
118
func (r * FileReader ) validateConfig () error {
119
- c := r .cfg
120
- if len (c .Run .Args ) != 0 {
119
+ if len (r .cfg .Run .Args ) != 0 {
121
120
return errors .New ("option run.args in config isn't supported now" )
122
121
}
123
122
124
- if c .Run .CPUProfilePath != "" {
123
+ if r . cfg .Run .CPUProfilePath != "" {
125
124
return errors .New ("option run.cpuprofilepath in config isn't allowed" )
126
125
}
127
126
128
- if c .Run .MemProfilePath != "" {
127
+ if r . cfg .Run .MemProfilePath != "" {
129
128
return errors .New ("option run.memprofilepath in config isn't allowed" )
130
129
}
131
130
132
- if c .Run .TracePath != "" {
131
+ if r . cfg .Run .TracePath != "" {
133
132
return errors .New ("option run.tracepath in config isn't allowed" )
134
133
}
135
134
136
- if c .Run .IsVerbose {
135
+ if r . cfg .Run .IsVerbose {
137
136
return errors .New ("can't set run.verbose option with config: only on command-line" )
138
137
}
139
- for i , rule := range c .Issues .ExcludeRules {
138
+
139
+ for i , rule := range r .cfg .Issues .ExcludeRules {
140
140
if err := rule .Validate (); err != nil {
141
141
return fmt .Errorf ("error in exclude rule #%d: %w" , i , err )
142
142
}
143
143
}
144
- if len (c .Severity .Rules ) > 0 && c .Severity .Default == "" {
144
+
145
+ if len (r .cfg .Severity .Rules ) > 0 && r .cfg .Severity .Default == "" {
145
146
return errors .New ("can't set severity rule option: no default severity defined" )
146
147
}
147
- for i , rule := range c .Severity .Rules {
148
+ for i , rule := range r . cfg .Severity .Rules {
148
149
if err := rule .Validate (); err != nil {
149
150
return fmt .Errorf ("error in severity rule #%d: %w" , i , err )
150
151
}
151
152
}
152
- if err := c .LintersSettings .Govet .Validate (); err != nil {
153
- return fmt .Errorf ("error in govet config: %w" , err )
154
- }
153
+
155
154
return nil
156
155
}
157
156
0 commit comments