cmd

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Check = &cli.Command{
	Name: "check",
	Subcommands: []*cli.Command{
		{
			Name: "quality",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:    "url",
					Aliases: []string{"u"},
				},
				&cli.StringFlag{
					Name:    "token",
					Aliases: []string{"t"},
				},
				&cli.StringFlag{
					Name:    "project_id",
					Aliases: []string{"p"},
				},
			},
			Action: func(c *cli.Context) error {
				request, err := makeClient(c)
				if err != nil {
					return err
				}

				if skip := os.Getenv("SONAR_SKIP"); skip == "true" {
					fmt.Println("skipped check")
					return nil
				}

				chk := eval.NewEvalBugVulnerability(request)

				status, err := chk.Run()
				if err != nil {
					return err
				}

				if status.Failed() {
					return fmt.Errorf(msg, status.QualityGateStatus, status.Bugs, status.CodeSmell, status.Vulnerability)
				}

				fmt.Println("check successful")
				return nil
			},
		},
	},
}

Functions

func Execute

func Execute(version string) error

Types

type CmdArg

type CmdArg func() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL