Documentation ¶
Overview ¶
The review package contains helper methods to create review requests to be sent to the bot endpoint layer, especially CLAIR.
Index ¶
- Variables
- func MakeReport(cliCtx *cli.Context, issues []*ReportStrt) (string, error)
- func NewRange(filename string, startLine, endLine int) *flow.IssueRange
- func ReadDotLingo(ctx *cli.Context) (string, error)
- func RequestReview(ctx context.Context, req *flow.ReviewRequest, insecure bool) (chan proto.Message, <-chan *flowutil.UserVar, chan error, error)
- type Options
- type PROpts
- type ReportStrt
Constants ¶
This section is empty.
Variables ¶
View Source
var CLIApp = &flowutil.CLIApp{ App: cli.App{ Name: "review", Usage: "Review code following tenets in codelingo.yaml.", Version: "0.0.0", Flags: []cli.Flag{ cli.StringFlag{ Name: util.DiffFlg.String(), Usage: "Review only unstaged changes in the working tree.", }, cli.StringFlag{ Name: util.OutputFlg.String(), Usage: "File to save found issues to.", }, cli.StringFlag{ Name: util.FormatFlg.String(), Value: "json-pretty", Usage: "How to format the found issues. Possible values are: json, json-pretty.", }, cli.BoolFlag{ Name: util.KeepAllFlg.String(), Usage: "Keep all issues and don't be prompted to confirm each issue.", }, cli.StringFlag{ Name: util.DirectoryFlg.String(), Usage: "Review a given directory.", }, cli.BoolFlag{ Name: "debug", Usage: "Display debug messages", }, cli.BoolFlag{ Name: "insecure", Hidden: true, Usage: "Review without TLS", }, cli.StringFlag{ Name: "repo", Usage: "Review a repo directly, e.g. github.com/some/repo", }, cli.StringFlag{ Name: "commit", Usage: "With --repo, review a specific commit", }, }, }, Tagline: "Automated Code Reviews", Request: reviewAction, }
View Source
var DecoratorApp = &flowutil.DecoratorApp{ App: cli.App{ Name: "review", Usage: "Comment on the decorated code.", Flags: []cli.Flag{}, }, ConfirmDecorated: decoratorAction, SetUserVar: func(v *flowutil.UserVar) { v.Set() }, DecoratorUsage: "<comment>", DecoratorExample: `"this is a review comment"`, }
Functions ¶
func MakeReport ¶
func MakeReport(cliCtx *cli.Context, issues []*ReportStrt) (string, error)
func ReadDotLingo ¶
Read a codelingo.yaml file from a filepath argument
Types ¶
type Options ¶
type Options struct { // TODO(waigani) validate PullRequest PullRequest string FilesAndDirs []string Diff bool // ctx.Bool("diff") TODO(waigani) this should be a sub-command which proxies to git diff SaveToFile string // ctx.String("save") KeepAll bool // ctx.Bool("keep-all") DotLingo string // ctx.Bool("lingo-file") }
Click to show internal directories.
Click to hide internal directories.