Documentation
¶
Overview ¶
Package codeowners needs documentation.
Index ¶
Constants ¶
const ( // EmailOwner is the owner type for email addresses. EmailOwner string = "email" // TeamOwner is the owner type for GitHub teams. TeamOwner string = "team" // UsernameOwner is the owner type for GitHub usernames. UsernameOwner string = "username" )
Variables ¶
This section is empty.
Functions ¶
func ConsolidateTree ¶
func FindFileAtStandardLocation ¶ added in v0.5.0
func FindFileAtStandardLocation() string
FindFileAtStandardLocation loops through the standard locations for CODEOWNERS files (./, .github/, docs/), and returns the first place a CODEOWNERS file is found. If run from a git repository, all paths are relative to the repository root.
Types ¶
type FileTree ¶
type FileTree struct {
// contains filtered or unexported fields
}
func NewFileTree ¶
type FilesPerOwner ¶ added in v0.5.0
type Owner ¶
type Owner struct {
// Value is the name of the owner: the email addres, team name, or username.
Value string
// Type will be one of 'email', 'team', or 'username'.
Type string
}
Owner represents an owner found in a rule.
type OwnerStats ¶ added in v0.5.0
type OwnerStats struct {
TotalFiles int `json:"totalFiles"`
OwnedFiles int `json:"ownedFiles"`
UnownedFiles int `json:"unownedFiles"`
OwnerCount int `json:"ownerCount"`
FilesPerOwner []FilesPerOwner `json:"filesPerOwner"`
}
func CalculateOwnershipStats ¶ added in v0.5.0
func CalculateOwnershipStats(files Owners) OwnerStats
type Owners ¶ added in v0.5.0
type Owners []*r
type Rule ¶
Rule is a CODEOWNERS rule that maps a gitignore-style path pattern to a set of owners.
func LoadFileAtRef ¶
LoadFileAtRef loads and parses a CODEOWNERS file from a historical commit. If ref is an empty string, file will be read from disk.
func LoadFileFromStandardLocation ¶
LoadFileFromStandardLocation loads and parses a CODEOWNERS file at one of the standard locations for CODEOWNERS files (./, .github/, docs/). If run from a git repository, all paths are relative to the repository root.
func (*Rule) RawPattern ¶
RawPattern returns the rule's gitignore-style path pattern.