vet/cmd/code/main.go
Oleksandr Redko 4e39cebe61
chore: add formatters to golangci-lint config (#643)
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-11-27 14:58:24 +05:30

29 lines
610 B
Go

package code
import (
"github.com/spf13/cobra"
"github.com/safedep/vet/internal/command"
)
var languageCodes []string
func NewCodeCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "code",
Short: "Analyze source code",
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
defaultAllLanguageCodes, err := getAllLanguageCodeStrings()
command.FailOnError("setup-default-languages", err)
cmd.PersistentFlags().StringArrayVar(&languageCodes, "lang", defaultAllLanguageCodes, "Source code languages to analyze")
cmd.AddCommand(newScanCommand())
return cmd
}