Fix #318: better validate linters and help commands
This commit is contained in:
parent
a4a7100011
commit
21c2590ba8
@ -44,6 +44,10 @@ func printLinterConfigs(lcs []linter.Config) {
|
||||
}
|
||||
|
||||
func (e Executor) executeLintersHelp(cmd *cobra.Command, args []string) {
|
||||
if len(args) != 0 {
|
||||
e.log.Fatalf("Usage: golangci-lint help linters")
|
||||
}
|
||||
|
||||
var enabledLCs, disabledLCs []linter.Config
|
||||
for _, lc := range e.DBManager.GetAllSupportedLinterConfigs() {
|
||||
if lc.EnabledByDefault {
|
||||
|
@ -31,6 +31,10 @@ func IsLinterInConfigsList(name string, linters []linter.Config) bool {
|
||||
}
|
||||
|
||||
func (e *Executor) executeLinters(cmd *cobra.Command, args []string) {
|
||||
if len(args) != 0 {
|
||||
e.log.Fatalf("Usage: golangci-lint linters")
|
||||
}
|
||||
|
||||
enabledLCs, err := e.EnabledLintersSet.Get()
|
||||
if err != nil {
|
||||
log.Fatalf("Can't get enabled linters: %s", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user