attribute

package
v1.25.0-dev Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LinguistVendored      = "linguist-vendored"
	LinguistGenerated     = "linguist-generated"
	LinguistDocumentation = "linguist-documentation"
	LinguistDetectable    = "linguist-detectable"
	LinguistLanguage      = "linguist-language"
	GitlabLanguage        = "gitlab-language"
	Lockable              = "lockable"
	Filter                = "filter"
)

Variables

Functions

func CheckAttributes

func CheckAttributes(ctx context.Context, gitRepo *git.Repository, treeish string, opts CheckAttributeOpts) (map[string]*Attributes, error)

CheckAttributes return the attributes of the given filenames and attributes in the given treeish. If treeish is empty, then it will use current working directory, otherwise it will use the provided treeish on the bare repo

Types

type Attribute

type Attribute string

func (Attribute) IsUnspecified

func (a Attribute) IsUnspecified() bool

func (Attribute) ToBool

func (a Attribute) ToBool() optional.Option[bool]

ToBool converts the attribute value to optional boolean: true if "set"/"true", false if "unset"/"false", none otherwise

func (Attribute) ToString

func (a Attribute) ToString() optional.Option[string]

type Attributes

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

func NewAttributes

func NewAttributes() *Attributes

func (*Attributes) Get

func (attrs *Attributes) Get(name string) Attribute

func (*Attributes) GetDetectable

func (attrs *Attributes) GetDetectable() optional.Option[bool]

func (*Attributes) GetDocumentation

func (attrs *Attributes) GetDocumentation() optional.Option[bool]

func (*Attributes) GetGenerated

func (attrs *Attributes) GetGenerated() optional.Option[bool]

func (*Attributes) GetGitlabLanguage

func (attrs *Attributes) GetGitlabLanguage() optional.Option[string]

func (*Attributes) GetLanguage

func (attrs *Attributes) GetLanguage() optional.Option[string]

func (*Attributes) GetLinguistLanguage

func (attrs *Attributes) GetLinguistLanguage() optional.Option[string]

func (*Attributes) GetVendored

func (attrs *Attributes) GetVendored() optional.Option[bool]

type BatchChecker

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

BatchChecker provides a reader for check-attribute content that can be long running

func NewBatchChecker

func NewBatchChecker(repo *git.Repository, treeish string, attributes []string) (checker *BatchChecker, returnedErr error)

NewBatchChecker creates a check attribute reader for the current repository and provided commit ID If treeish is empty, then it will use current working directory, otherwise it will use the provided treeish on the bare repo

func (*BatchChecker) CheckPath

func (c *BatchChecker) CheckPath(path string) (rs *Attributes, err error)

CheckPath check attr for given path

func (*BatchChecker) Close

func (c *BatchChecker) Close() error

type CheckAttributeOpts

type CheckAttributeOpts struct {
	Filenames  []string
	Attributes []string
}

Jump to

Keyboard shortcuts

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