Documentation
¶
Index ¶
- Variables
- func CLIMenu(config *Config) *cobra.Command
- func CheckGitAndHooksDir() error
- func CheckStatus(config *Config)
- func ExecuteCommand(command string, args ...string) (string, error)
- func ExecuteGitCommand(args ...string) (string, error)
- func GetCurrentBranchName() (string, error)
- func GetGlobalBinPath() (string, error)
- func IsJiraFlowActive() bool
- func RemoveGitHooks(hookPath string) error
- func RemoveHooks(config *Config) error
- func SetCommitMsgHook(config *Config) error
- func SetGitHooks(config *Config) error
- func SetPostCheckoutHook(config *Config) error
- func ToggleJiraFlow(config *Config, enable bool) error
- type Config
- type JiraManager
Constants ¶
This section is empty.
Variables ¶
View Source
var GetHooksPath = func() string {
return ".git/hooks"
}
GetHooksPath returns the path to the git hooks directory This can be overridden in tests
View Source
var InstallHooks = func(config *Config) error { hooksPath := GetHooksPath() hooks := map[string]string{ "commit-msg": getBinaryPath(config, "commitmsg"), "post-checkout": getBinaryPath(config, "postco"), } for hookName, binaryPath := range hooks { hookPath := filepath.Join(hooksPath, hookName) if err := os.Symlink(binaryPath, hookPath); err != nil && !os.IsExist(err) { return fmt.Errorf("failed to install %s hook: %w", hookName, err) } } return nil }
Make InstallHooks mockable for testing
Functions ¶
func CheckGitAndHooksDir ¶
func CheckGitAndHooksDir() error
func CheckStatus ¶ added in v0.4.0
func CheckStatus(config *Config)
func ExecuteGitCommand ¶
Function to execute git commands
func GetCurrentBranchName ¶
func GetGlobalBinPath ¶
func IsJiraFlowActive ¶ added in v0.4.0
func IsJiraFlowActive() bool
func RemoveGitHooks ¶ added in v0.3.0
func RemoveHooks ¶ added in v0.4.0
func SetCommitMsgHook ¶ added in v0.2.0
func SetGitHooks ¶ added in v0.2.0
configures all necessary Git hooks
func SetPostCheckoutHook ¶ added in v0.2.0
func ToggleJiraFlow ¶ added in v0.4.0
Types ¶
type Config ¶
type JiraManager ¶
type JiraManager struct {
Config *Config
}
JiraManager handles operations related to JIRA issues.
func NewJiraManager ¶
func NewJiraManager(config *Config) *JiraManager
NewJiraManager creates a new instance of JiraManager with the provided configuration.
func (*JiraManager) ConfigureAutomatic ¶ added in v0.5.0
func (jm *JiraManager) ConfigureAutomatic() error
ConfigureAutomatic sets up automatic JIRA issue key extraction from branch names
func (*JiraManager) ExtractIssueKeyFromBranchName ¶
func (jm *JiraManager) ExtractIssueKeyFromBranchName(branchName string) (string, error)
func (*JiraManager) ValidateJiraKey ¶
func (jm *JiraManager) ValidateJiraKey( input string, ) (string, error)
Click to show internal directories.
Click to hide internal directories.