filestaged

package
v0.0.0-...-832881f Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAll

func NewAll(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Condition

func NewAny

func NewAny(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Condition

func NewThatIs

func NewThatIs(appIO io.IO, conf *configuration.Configuration, repo git.Repo) hooks.Condition

Types

type All

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

All makes sure an action is only executed if all the configured files are staged. Only applicable for 'pre-commit' hooks.

Example configuration:

{
  "run": "echo ARRRRRR",
  "conditions": [
    {
      "run": "CaptainHook::FilesStaged.All",
      "options": {
        "files": ["foo.txt", "bar.txt"]
      }
    }
  ]
}

func (*All) IsApplicableFor

func (c *All) IsApplicableFor(hook string) bool

func (*All) IsTrue

func (c *All) IsTrue(condition *configuration.Condition) bool

type Any

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

Any makes sure an action is only executed if any of the configured files is staged. Only applicable for 'pre-commit' hooks.

Example configuration:

{
  "run": "echo ARRRRRR",
  "conditions": [
    {
      "run": "CaptainHook::FilesStaged.Any",
      "options": {
        "files": ["foo.txt", "bar.txt"]
      }
    }
  ]
}

func (*Any) IsApplicableFor

func (c *Any) IsApplicableFor(hook string) bool

func (*Any) IsTrue

func (c *Any) IsTrue(condition *configuration.Condition) bool

type ThatIs

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

ThatIs makes sure an action is only executed if a file with the given configuration is staged. Only applicable for 'pre-commit' hooks.

Example configuration:

{
  "run": "echo ARRRRRR",
  "conditions": [
    {
      "run": "CaptainHook::FilesStaged.ThatIs",
      "options": {
        "of-type": "md",
        "in-directory": "docs"
      }
    }
  ]
}

func (*ThatIs) IsApplicableFor

func (c *ThatIs) IsApplicableFor(hook string) bool

func (*ThatIs) IsTrue

func (c *ThatIs) IsTrue(condition *configuration.Condition) bool

Jump to

Keyboard shortcuts

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