labels

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 8 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 labels reads and validates .github/labels.yml, the repository labels that tools/labelsync syncs to GitHub and tools/communitycheck checks in CI (Story 4.14).

Index

Constants

View Source
const BackportPrefix = "backport "

BackportPrefix starts the label of every supported release branch.

View Source
const Path = ".github/labels.yml"

Path is the labels file, relative to the repository root.

Variables

View Source
var Required = []string{
	"good first issue", "registry", "false-positive", "provider", "surface", "security",
	"fuzz", "possible-secret", "release-blocker", "ci-nightly",
}

Required are the labels the story and the workflows rely on: issue forms, issue-guard (possible-secret), triage and the nightly CI issue (ci-nightly).

Functions

func Parse

func Parse(data []byte) (*File, []Problem)

Parse decodes data strictly (unknown fields are errors) and records each label's line. A decode error is returned as a single problem.

Types

type File

type File struct {
	SupportedBranches []string `yaml:"supported_branches"`
	Labels            []Label  `yaml:"labels"`
}

File is the parsed labels file.

func (*File) Names

func (f *File) Names() []string

Names returns the label names of f.

type Label

type Label struct {
	Name        string `yaml:"name"`
	Color       string `yaml:"color"`
	Description string `yaml:"description"`
	// Line is the line of the label's entry in the file.
	Line int `yaml:"-"`
}

Label is one repository label.

type Problem

type Problem struct {
	Line int
	Msg  string
}

Problem is one validation error at a line of the file.

func Check

func Check(f *File) []Problem

Check validates a parsed labels file.

func (Problem) String

func (p Problem) String() string

Jump to

Keyboard shortcuts

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