Documentation
¶
Index ¶
- func ListFormatFunc(es []codeowners.Entry) string
- type Checker
- type DuplicatedPatternChecker
- type FileExistChecker
- type Input
- type Issue
- type NotOwnedFileChecker
- func (c *NotOwnedFileChecker) AppendToGitignoreFile(repoDir string, patterns []string) error
- func (c *NotOwnedFileChecker) Check(ctx context.Context, in Input) (output Output, err error)
- func (c *NotOwnedFileChecker) GitCheckStatus(repoDir string) error
- func (c *NotOwnedFileChecker) GitListFiles(repoDir string) (string, error)
- func (c *NotOwnedFileChecker) GitRemoveIgnoredFiles(repoDir string) error
- func (c *NotOwnedFileChecker) GitResetCurrentBranch(repoDir string) error
- func (c *NotOwnedFileChecker) ListFormatFunc(es []string) string
- func (NotOwnedFileChecker) Name() string
- type NotOwnedFileCheckerConfig
- type Opt
- type Output
- type SeverityType
- type ValidOwnerChecker
- type ValidOwnerCheckerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListFormatFunc ¶ added in v0.2.0
func ListFormatFunc(es []codeowners.Entry) string
ListFormatFunc is a basic formatter that outputs a bullet point list of the pattern.
Types ¶
type DuplicatedPatternChecker ¶ added in v0.2.0
type DuplicatedPatternChecker struct{}
DuplicatedPatternChecker validates if CODEOWNERS file does not contain the duplicated lines with the same file pattern.
func NewDuplicatedPattern ¶ added in v0.2.0
func NewDuplicatedPattern() *DuplicatedPatternChecker
NewDuplicatedPattern returns instance of the DuplicatedPatternChecker
func (*DuplicatedPatternChecker) Check ¶ added in v0.2.0
Check searches for doubles paths(patterns) in CODEOWNERS file.
func (DuplicatedPatternChecker) Name ¶ added in v0.2.0
func (DuplicatedPatternChecker) Name() string
Name returns human readable name of the validator.
type FileExistChecker ¶
type FileExistChecker struct{}
func NewFileExist ¶
func NewFileExist() *FileExistChecker
func (FileExistChecker) Name ¶
func (FileExistChecker) Name() string
type Input ¶
type Input struct { RepoDir string CodeownerEntries []codeowners.Entry }
type Issue ¶
type Issue struct { Severity SeverityType // enum // default error LineNo *uint64 Message string }
type NotOwnedFileChecker ¶ added in v0.2.0
type NotOwnedFileChecker struct {
// contains filtered or unexported fields
}
func NewNotOwnedFile ¶ added in v0.2.0
func NewNotOwnedFile(cfg NotOwnedFileCheckerConfig) *NotOwnedFileChecker
func (*NotOwnedFileChecker) AppendToGitignoreFile ¶ added in v0.2.0
func (c *NotOwnedFileChecker) AppendToGitignoreFile(repoDir string, patterns []string) error
func (*NotOwnedFileChecker) GitCheckStatus ¶ added in v0.2.0
func (c *NotOwnedFileChecker) GitCheckStatus(repoDir string) error
func (*NotOwnedFileChecker) GitListFiles ¶ added in v0.2.0
func (c *NotOwnedFileChecker) GitListFiles(repoDir string) (string, error)
func (*NotOwnedFileChecker) GitRemoveIgnoredFiles ¶ added in v0.2.0
func (c *NotOwnedFileChecker) GitRemoveIgnoredFiles(repoDir string) error
func (*NotOwnedFileChecker) GitResetCurrentBranch ¶ added in v0.2.0
func (c *NotOwnedFileChecker) GitResetCurrentBranch(repoDir string) error
func (*NotOwnedFileChecker) ListFormatFunc ¶ added in v0.2.0
func (c *NotOwnedFileChecker) ListFormatFunc(es []string) string
ListFormatFunc is a basic formatter that outputs a bullet point list of the pattern.
func (NotOwnedFileChecker) Name ¶ added in v0.2.0
func (NotOwnedFileChecker) Name() string
Name returns human readable name of the validator
type NotOwnedFileCheckerConfig ¶ added in v0.2.0
type NotOwnedFileCheckerConfig struct {
SkipPatterns []string `envconfig:"optional"`
}
type Opt ¶
type Opt func(*Issue)
func WithEntry ¶ added in v0.2.0
func WithEntry(e codeowners.Entry) Opt
func WithSeverity ¶
func WithSeverity(s SeverityType) Opt
type SeverityType ¶
type SeverityType int
const ( Error SeverityType = iota + 1 Warning )
func (SeverityType) String ¶
func (s SeverityType) String() string
func (*SeverityType) Unmarshal ¶ added in v0.2.0
func (s *SeverityType) Unmarshal(in string) error
Unmarshal provides custom parsing of severity type. Implements envconfig.Unmarshal interface.
type ValidOwnerChecker ¶
type ValidOwnerChecker struct {
// contains filtered or unexported fields
}
ValidOwnerChecker validates each owner
func NewValidOwner ¶
func NewValidOwner(cfg ValidOwnerCheckerConfig, ghClient *github.Client) *ValidOwnerChecker
NewValidOwner returns new instance of the ValidOwnerChecker
func (*ValidOwnerChecker) Check ¶
Check check if defined owners are the valid ones. Allowed owner syntax: @username @org/team-name user@example.com source: https://help.github.com/articles/about-code-owners/#codeowners-syntax
Checks: - if owner is one of: github user, org team, email address - if github user then check if have github account - if github user then check if he/she is in organization - if org team then check if exists in organization
func (ValidOwnerChecker) Name ¶
func (ValidOwnerChecker) Name() string
Name returns human readable name of the validator
type ValidOwnerCheckerConfig ¶
type ValidOwnerCheckerConfig struct {
OrganizationName string
}