Documentation
¶
Index ¶
- Constants
- func AwsPatterns() []string
- func GetPreset(name string) ([]string, error)
- func GitHubPatterns() []string
- func GooglePatterns() []string
- func NewBlockSecrets(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
- func NewDoesNotContainRegex(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
- func NewIsNotEmpty(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
- func NewMaxSize(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
- func StripePatterns() []string
- type BlockSecrets
- type DoesNotContainRegex
- type IsNotEmpty
- type MaxSize
Constants ¶
View Source
const ( Quote = "(\"|')" OptQuote = Quote + "?" Connect = "\\s*(:|=>|=|:=)\\s*" )
Variables ¶
This section is empty.
Functions ¶
func AwsPatterns ¶
func AwsPatterns() []string
func GitHubPatterns ¶
func GitHubPatterns() []string
func GooglePatterns ¶
func GooglePatterns() []string
func NewBlockSecrets ¶
func NewBlockSecrets(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
func NewDoesNotContainRegex ¶
func NewDoesNotContainRegex(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
func NewIsNotEmpty ¶
func NewIsNotEmpty(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
func NewMaxSize ¶
func NewMaxSize(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Action
func StripePatterns ¶
func StripePatterns() []string
Types ¶
type BlockSecrets ¶
type BlockSecrets struct {
// contains filtered or unexported fields
}
BlockSecrets blocks commits if a file is containing a string matching any if the given regexes.
Example configuration:
{
"run": "CaptainHook::File.BlockSecrets",
"options: {
"presets": ["Aws", "GitHub", "Stripe", "Google"],
"blocked": ["pattern1", "pattern2"],
"allowed": ["patternA"]
}
}
func (*BlockSecrets) IsApplicableFor ¶
func (a *BlockSecrets) IsApplicableFor(hook string) bool
func (*BlockSecrets) Run ¶
func (a *BlockSecrets) Run(action *configuration.Action) error
type DoesNotContainRegex ¶
type DoesNotContainRegex struct {
// contains filtered or unexported fields
}
DoesNotContainRegex blocks commits if a file is containing a string matching the given regex.
Example configuration:
{
"run": "CaptainHook::File.DoesNotContainRegex",
"options: {
"regex": "shouldNotContainThis"
}
}
func (*DoesNotContainRegex) IsApplicableFor ¶
func (a *DoesNotContainRegex) IsApplicableFor(hook string) bool
func (*DoesNotContainRegex) Run ¶
func (a *DoesNotContainRegex) Run(action *configuration.Action) error
type IsNotEmpty ¶
type IsNotEmpty struct {
// contains filtered or unexported fields
}
IsNotEmpty is preventing you from committing empty files to the repository
Example configuration:
{
"run": "CaptainHook::File:IsNotEmpty",
"options": {
"files": ["README.md", "LICENSE.md"]
}
}
func (*IsNotEmpty) IsApplicableFor ¶
func (a *IsNotEmpty) IsApplicableFor(hook string) bool
func (*IsNotEmpty) Run ¶
func (a *IsNotEmpty) Run(action *configuration.Action) error
type MaxSize ¶
type MaxSize struct {
// contains filtered or unexported fields
}
MaxSize is preventing you from committing files exceeding a given size limit
Example configuration:
{
"run": "CaptainHook::File:MaxSize",
"options": {
"max-size": "10M"
}
}
func (*MaxSize) IsApplicableFor ¶
Click to show internal directories.
Click to hide internal directories.