tag

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 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 tag names what a pull request touches with key:value tags, a matching system and nothing more: nine fixed keys, each value normalized to one spelling.

Index

Constants

View Source
const (
	MaxPerKey = 3
	Max       = 16
)

Variables

View Source
var Keys = []Key{
	{Name: "lang", Seeds: []string{"python", "go", "typescript", "javascript", "java", "kotlin", "ruby", "rust", "php", "csharp", "cpp", "c", "sql", "shell", "hcl", "yaml", "html", "css", "markdown"}},
	{Name: "framework", Seeds: []string{"django", "flask", "fastapi", "react", "nextjs", "vue", "rails", "spring", "express"}},
	{Name: "tool", Seeds: []string{"docker", "kubernetes", "terraform", "github-actions", "helm", "make", "npm", "poetry"}},
	{Name: "area", Closed: []string{"api", "ui", "cli", "data-model", "migration", "ci", "build", "deps", "docs", "tests", "config", "infra", "observability", "auth", "storage", "messaging", "jobs"}},
	{Name: "change", Closed: []string{"feature", "fix", "refac", "perf", "docs", "test", "deps", "config", "chore", "revert", "rename", "removal", "migration", "security"}},
	{Name: "concern", Closed: []string{"security", "privacy", "compliance", "performance", "data-loss", "concurrency", "backward-compat", "accessibility", "i18n", "cost", "reliability"}},
	{Name: "breaking", Closed: []string{"api", "schema", "config", "behavior", "cli"}},
	{Name: "domain"},
	{Name: "audience", Closed: []string{"end-user", "internal", "developer", "operator"}},
}

Functions

func FromObject

func FromObject(raw map[string][]string) (tags, dropped []string)

FromObject normalizes the brief's tag object into key:value tags, in Keys order and then the model's, at most MaxPerKey per key and Max in all; dropped lists, as key:value, what was refused or over a limit.

func Normalize

func Normalize(key, value string) (string, bool)

Normalize gives value's one spelling under key, false when key is not one of Keys or the value does not make a tag.

func OpenKeys

func OpenKeys() []string

OpenKeys names the open keys, in Keys order.

func Parse

func Parse(s string) (key, value string, ok bool)

Parse splits a stored key:value tag; ok only when it is already normalized.

func Vocabulary

func Vocabulary(v map[string][]Count) string

Vocabulary lists, one open key per line in Keys order, the values in use with their counts, then the unused seeds, in the order given.

func WithSeeds

func WithSeeds(v map[string][]Count, limit int) map[string][]Count

WithSeeds adds to v each open key's seeds that v does not list, with a zero count, up to limit values per key.

Types

type Count

type Count struct {
	Value string
	Count int
}

type Key

type Key struct {
	Name string
	// Closed lists the values a closed key accepts; nil for an open key.
	Closed []string
	// Seeds are the open key's usual values, which the vocabulary lists
	// after the ones in use.
	Seeds []string
}

func (Key) Open

func (k Key) Open() bool

Jump to

Keyboard shortcuts

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