focus

package
v1.0.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation ΒΆ

Overview ΒΆ

Package focus parses a runner's focus, a board filter in GitHub's syntax such as `team:Bumblebee customer:Acme` or `kind:"Bug 🐞"`, and matches it against the fields a task carries.

A filter is a list of qualifiers, all of which must hold:

  • `field:value` holds when the field has the value. `field:a,b` holds when it has either. Values may be quoted: `kind:"Bug 🐞"`.
  • `-field:value` holds when the field has none of the values.
  • `has:field` holds when the field has a value, `no:field` when it has none.

Field names and values compare without regard to case, and a field name ignores dashes, underscores and spaces, so `parent-issue` and `parentIssue` are one field. Nothing about a field is hard-coded.

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

This section is empty.

Functions ΒΆ

This section is empty.

Types ΒΆ

type Filter ΒΆ

type Filter struct {
	// contains filtered or unexported fields
}

Filter is a parsed focus. The zero Filter matches every task.

func MustParse ΒΆ

func MustParse(s string) Filter

MustParse is Parse for focuses known to be valid, such as in tests.

func Parse ΒΆ

func Parse(s string) (Filter, error)

Parse parses a focus. An empty focus matches every task.

func (Filter) Empty ΒΆ

func (f Filter) Empty() bool

Empty reports whether the filter matches every task.

func (Filter) Match ΒΆ

func (f Filter) Match(fields map[string][]string) bool

Match reports whether a task with these fields is in focus.

func (Filter) String ΒΆ

func (f Filter) String() string

String returns the focus as it was written.

Jump to

Keyboard shortcuts

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