internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixStepID       = "prefix"
	PrefixSkipMsg      = "No prefixes to check"
	PrefixErrMsg       = "PR title does not have any required prefix (%s)"
	PrefixSuccesMsg    = "Prefixes check passed"
	LabelsStepID       = "labels"
	LabelsSkipMsg      = "No labels to check"
	LabelsErrMsg       = "PR does not have any required labels"
	LabelsSuccesMsg    = "Labels check passed"
	RegexpStepID       = "regexp"
	RegexpSkipMsg      = "No regexep to check"
	RegexpErrMsg       = "PR title does not match specified regular expression"
	RegexpSuccesMsg    = "Regular expression check passed"
	ChecklistStepID    = "checklist"
	ChecklistSkipMsg   = "Checklist checks disabled"
	ChecklistErrMsg    = "Found %d unchecked checklist items"
	ChecklistSuccesMsg = "Checklist check passed"
)

Variables

View Source
var BaseURL = "https://api.github.com"

Functions

func GetEnvVar

func GetEnvVar(name, defaultValue string) string

Types

type Client

type Client struct {
	Http *http.Client
	URL  *url.URL
	// contains filtered or unexported fields
}

func (*Client) GetPullRequest

func (c *Client) GetPullRequest() (PullRequest, error)

type GitHub

type GitHub interface {
	GetPullRequest() (PullRequest, error)
}

func NewGithub

func NewGithub(url *url.URL, token string) GitHub

type Label

type Label struct {
	Name string `json:"name"`
}

type Plugin

type Plugin interface {
	Report()
	CheckPrTitlePrefixes() *PullRequestChecker
	CheckPRChecklist() *PullRequestChecker
	CheckPRLabels() *PullRequestChecker
	CheckPRTitleRegexep() *PullRequestChecker
}

type PullRequest

type PullRequest struct {
	Labels []Label `json:"labels"`
	Body   string  `json:"body"`
}

type PullRequestChecker

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

func NewPlugin

func NewPlugin(url *url.URL, token string) PullRequestChecker

func (*PullRequestChecker) CheckPRChecklist

func (prc *PullRequestChecker) CheckPRChecklist() *PullRequestChecker

func (*PullRequestChecker) CheckPRLabels

func (prc *PullRequestChecker) CheckPRLabels() *PullRequestChecker

func (*PullRequestChecker) CheckPRTitlePrefixes

func (prc *PullRequestChecker) CheckPRTitlePrefixes() *PullRequestChecker

func (*PullRequestChecker) CheckPRTitleRegexep

func (prc *PullRequestChecker) CheckPRTitleRegexep() *PullRequestChecker

func (*PullRequestChecker) Report

func (prc *PullRequestChecker) Report()

type Settings

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

type State

type State int
const (
	Success State = iota
	Err
	Skip
)

type Step

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

Jump to

Keyboard shortcuts

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