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 {
115115// DefaultConfToFile writes default config to given file
116116func DefaultConfToFile (isOnlyEnabled bool ) error {
117117 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+ }
123121
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+ }
129126
130- return WriteConfToFile (outPath , confClone )
127+ for ruleName , r := range defConf .Rules {
128+ if r .Enabled {
129+ confClone .Rules [ruleName ] = r
130+ }
131131 }
132- return WriteConfToFile (outPath , defConf )
132+ return WriteConfToFile (outPath , confClone )
133133}
134134
135135// WriteConfToFile util func to write config object to given file
You can’t perform that action at this time.
0 commit comments