File tree 2 files changed +15
-10
lines changed
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ func (c *formattersCommand) execute(_ *cobra.Command, _ []string) error {
84
84
return fmt .Errorf ("can't get enabled formatters: %w" , err )
85
85
}
86
86
87
- var enabledLinters []* linter.Config
88
- var disabledLCs []* linter.Config
87
+ var enabledFormatters []* linter.Config
88
+ var disabledFormatters []* linter.Config
89
89
90
90
for _ , lc := range c .dbManager .GetAllSupportedLinterConfigs () {
91
91
if lc .Internal {
@@ -97,16 +97,16 @@ func (c *formattersCommand) execute(_ *cobra.Command, _ []string) error {
97
97
}
98
98
99
99
if enabledLintersMap [lc .Name ()] == nil {
100
- disabledLCs = append (disabledLCs , lc )
100
+ disabledFormatters = append (disabledFormatters , lc )
101
101
} else {
102
- enabledLinters = append (enabledLinters , lc )
102
+ enabledFormatters = append (enabledFormatters , lc )
103
103
}
104
104
}
105
105
106
106
color .Green ("Enabled by your configuration formatters:\n " )
107
- printFormatters (enabledLinters )
107
+ printFormatters (enabledFormatters )
108
108
color .Red ("\n Disabled by your configuration formatters:\n " )
109
- printFormatters (disabledLCs )
109
+ printFormatters (disabledFormatters )
110
110
111
111
return nil
112
112
}
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ func newHelpCommand(logger logutils.Log) *helpCommand {
47
47
PreRunE : c .lintersPreRunE ,
48
48
}
49
49
50
+ fsLinter := lintersCmd .Flags ()
51
+ fsLinter .SortFlags = false // sort them as they are defined here
52
+
53
+ fsLinter .BoolVar (& c .opts .JSON , "json" , false , color .GreenString ("Display as JSON" ))
54
+
50
55
helpCmd .AddCommand (lintersCmd )
51
56
52
57
formattersCmd := & cobra.Command {
@@ -58,12 +63,12 @@ func newHelpCommand(logger logutils.Log) *helpCommand {
58
63
PreRunE : c .formattersPreRunE ,
59
64
}
60
65
61
- helpCmd .AddCommand (formattersCmd )
66
+ fsFormatter := formattersCmd .Flags ()
67
+ fsFormatter .SortFlags = false // sort them as they are defined here
62
68
63
- fs := lintersCmd .Flags ()
64
- fs .SortFlags = false // sort them as they are defined here
69
+ fsFormatter .BoolVar (& c .opts .JSON , "json" , false , color .GreenString ("Display as JSON" ))
65
70
66
- fs . BoolVar ( & c . opts . JSON , "json" , false , color . GreenString ( "Display as JSON" ) )
71
+ helpCmd . AddCommand ( formattersCmd )
67
72
68
73
c .cmd = helpCmd
69
74
You can’t perform that action at this time.
0 commit comments