Documentation
¶
Overview ¶
Package prfilter reads and applies the pull-request filter language, such as `repo=acme/app is!=draft (review=approved OR risk>=4) flaky`. It is the Go twin of app/src/pr-filter.ts: the two must agree, and the shared testdata/cases.json keeps them so.
Index ¶
Constants ¶
const ( KindAnd = "and" KindOr = "or" KindNot = "not" KindTerm = "term" KindText = "text" )
Expr kinds.
const MaxQuery = 500
MaxQuery is the longest query, in UTF-16 units as JavaScript counts them.
Variables ¶
This section is empty.
Functions ¶
func FoldedQuery ¶
FoldedQuery is an inbox's parts as one query: what it holds (waiting= or, for the person's own, author=@me), owners (org=), risk (risk>=), repositories (repo=) and bots (is!=bot), then its own query.
Types ¶
type Matcher ¶
type Matcher func(e reviewindex.Entry, kind string) bool
Matcher reports whether a pull request passes a compiled query; kind is what it waits for in an inbox's queue ("" for none, where waiting holds for nothing).
type Node ¶
type Node struct {
Kind string
// Items are the operands of an and/or; Item is the operand of a not.
Items []Expr
Item Expr
// A term's field, operator and values.
Key string
Op string
Values []string
// Text is the word a text expression looks for.
Text string
// Grouped is set on an expression written in parentheses of its own.
Grouped bool
}
Node is a parsed filter expression.