Documentation
¶
Index ¶
Constants ¶
View Source
const ( TitleValidatorName = "Pull request has a valid title" IssueValidatorName = "Pull request has mentioned issues" FileValidatorName = "Pull request does not introduce too many changes" CommitValidatorName = "All commits in this pull request has valid messages" VerifiedCommitsValidatorName = "All commits in this pull request come from verified users" BodyValidatorName = "Pull request should have a non-empty body" BranchValidatorName = "Pull request has valid branch name" )
Validator names
View Source
const ( BotWhitelistName = "Pull request is submitted by a bot and should be ignored" DraftWhitelistName = "Pull request is a draft and should be ignored" PermissionWhitelistName = "Pull request is submitted by administrators and should be ignored" UsernameWhitelistName = "Pull request is made by a whitelisted user and should be ignored" )
Whitelist names
View Source
const ( // PassEmoji is the emoji to use when a whitelist or validator pass PassEmoji = "✅" // FailEmoji is the emoji to use when a whitelist or validator fails FailEmoji = "❌" )
View Source
const ( BotUser = "bot" NormalUser = "user" )
User types
View Source
const (
AdminUser = "admin"
)
Permission levels
View Source
const (
Closed = "closed"
)
Issue (extends to pull requests) state
Variables ¶
View Source
var ( ErrMissingToken = errors.New("[Config] Access token is empty") ErrNegativeFileChange = errors.New("[Config] Maximum file change must not be a negative number") ErrInvalidTitlePattern = errors.New("[Config] Invalid pull request title pattern") ErrInvalidCommitPattern = errors.New("[Config] Invalid pull request commit message pattern") ErrInvalidBranchPattern = errors.New("[Config] Invalid pull request branch name pattern") ErrInvalidBaseURL = errors.New("[Config] Invalid GitHub API base URL") )
Config error
View Source
var ( ErrEventFileRead = errors.New("[Event] Failed to read event file") ErrEventFileParse = errors.New("[Event] Failed to parse event file") )
Event error
View Source
var ( ErrInvalidTitle = errors.New("pull request title does not follow the desired pattern") ErrNoBody = errors.New("pull request must have a non-empty body") ErrNoIssue = errors.New("pull request does not mention any issues") ErrTooManyChanges = errors.New("pull request introduces too many changes") ErrInvalidBranch = errors.New("pull request branch name does not follow the desired pattern") )
validator error
View Source
var ( ReportHeader = `` /* 145-byte string literal not displayed */ WhitelistTemplate = `### **Whitelist Report** %s %s` ValidatorTemplate = `### **Validation Report** %s %s` ResultTemplate = `**Result** %s` ReasonTemplate = `**Reason** %s` WhitelistPass = "Pull request matches with one (or more) enabled whitelist criteria. Pull request validation is skipped." WhitelistFail = "Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated." ValidationPass = "Pull request satisfies all enabled pull request rules." ValidationFail = "Pull request is invalid." LogHeader = `` /* 360-byte string literal not displayed */ )
Report template
View Source
var (
ErrFirstComment = errors.New("no existing report was found")
)
GitHub API error
View Source
var (
ErrMalformedMetadata = errors.New("[Meta] Malformed repository metadata")
)
Metadata error
View Source
var ( // Events stores a list of pull request sub-events to be processed Events = []string{"opened", "reopened", "ready_for_review", "synchronize", "unlocked", "edited"} )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.