codeowners

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package codeowners reads GitHub's CODEOWNERS format and answers who owns each package, for the owner boundary of Balanced Coupling's distance (connascence.md §9.3). Parsing and matching are github.com/hmarr/codeowners; this package turns its rules into owners per package. The shell reads the file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(rs Rules, p *arch.Program) map[string][]string

Resolve returns the owners of each package of p: the sorted union of the owners of its files. A package none of whose files has an owner is left out.

Types

type Rules

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

Rules are a file's rules in order. The last rule that matches a path wins, as on GitHub; a rule with no owners leaves its paths unowned.

func Parse

func Parse(r io.Reader) (Rules, error)

Parse reads a CODEOWNERS file. Blank lines and comments are skipped; a line the format does not allow is EINVALID, naming the line.

func (Rules) Owners

func (rs Rules) Owners(path string) []string

Owners returns the sorted owners of a path relative to the repository root: those of the last rule that matches the path or a directory holding it. A path no rule matches has none.

Jump to

Keyboard shortcuts

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