mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
Fix #318: better validate linters and help commands
This commit is contained in:
parent
a4a7100011
commit
21c2590ba8
2 changed files with 8 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue