File tree Expand file tree Collapse file tree 3 files changed +6
-28
lines changed
Expand file tree Collapse file tree 3 files changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -149,22 +149,7 @@ var defRuleConf = map[string]lint.RuleConfig{
149149 },
150150}
151151
152- // GetDefaultConfig writes default config to given file
153- func GetDefaultConfig (onlyEnabled bool ) * lint.Config {
154- if ! onlyEnabled {
155- return defConf
156- }
157-
158- confClone := & lint.Config {
159- MinVersion : defConf .MinVersion ,
160- Formatter : defConf .Formatter ,
161- Rules : map [string ]lint.RuleConfig {},
162- }
163-
164- for ruleName , r := range defConf .Rules {
165- if r .Enabled {
166- confClone .Rules [ruleName ] = r
167- }
168- }
169- return confClone
152+ // Default returns default config
153+ func Default () * lint.Config {
154+ return defConf
170155}
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ func hookCreate(confPath string, isReplace bool) error {
4747}
4848
4949// configCreate is the callback function for create config command
50- func configCreate (onlyEnabled , isReplace bool ) error {
51- defConf := config .GetDefaultConfig ( onlyEnabled )
50+ func configCreate (isReplace bool ) error {
51+ defConf := config .Default ( )
5252 outPath := filepath .Join ("." , config .ConfigFile )
5353 // if config file already exists skip creating or overwriting it
5454 if _ , err := os .Stat (outPath ); ! os .IsNotExist (err ) {
Original file line number Diff line number Diff line change @@ -99,12 +99,6 @@ func configCmd() *cli.Command {
9999 Name : "create" ,
100100 Usage : "Creates default config in current directory" ,
101101 Flags : []cli.Flag {
102- & cli.BoolFlag {
103- Name : "enabled" ,
104- Aliases : []string {"e" },
105- Usage : "writes only default enabled rules" ,
106- Value : false ,
107- },
108102 & cli.BoolFlag {
109103 Name : "replace" ,
110104 Aliases : []string {"r" },
@@ -113,9 +107,8 @@ func configCmd() *cli.Command {
113107 },
114108 },
115109 Action : func (ctx * cli.Context ) error {
116- isOnlyEnabled := ctx .Bool ("enabled" )
117110 isReplace := ctx .Bool ("replace" )
118- err := configCreate (isOnlyEnabled , isReplace )
111+ err := configCreate (isReplace )
119112 if err != nil {
120113 if isConfExists (err ) {
121114 fmt .Println ("config create failed" )
You can’t perform that action at this time.
0 commit comments