File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -115,21 +115,21 @@ func Validate(conf *lint.Config) error {
115
115
// DefaultConfToFile writes default config to given file
116
116
func DefaultConfToFile (isOnlyEnabled bool ) error {
117
117
outPath := filepath .Join ("." , filepath .Clean (ConfFileName ))
118
- if isOnlyEnabled {
119
- confClone := & lint.Config {
120
- Formatter : defConf .Formatter ,
121
- Rules : map [string ]lint.RuleConfig {},
122
- }
118
+ if ! isOnlyEnabled {
119
+ return WriteConfToFile (outPath , defConf )
120
+ }
123
121
124
- for ruleName , r := range defConf .Rules {
125
- if r .Enabled {
126
- confClone .Rules [ruleName ] = r
127
- }
128
- }
122
+ confClone := & lint.Config {
123
+ Formatter : defConf .Formatter ,
124
+ Rules : map [string ]lint.RuleConfig {},
125
+ }
129
126
130
- return WriteConfToFile (outPath , confClone )
127
+ for ruleName , r := range defConf .Rules {
128
+ if r .Enabled {
129
+ confClone .Rules [ruleName ] = r
130
+ }
131
131
}
132
- return WriteConfToFile (outPath , defConf )
132
+ return WriteConfToFile (outPath , confClone )
133
133
}
134
134
135
135
// WriteConfToFile util func to write config object to given file
You can’t perform that action at this time.
0 commit comments