helper

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prompt = []*survey.Question{
	{
		Name: "types",
		Prompt: &survey.Select{
			Message: "Type of Change?:",
			Options: []string{
				"feat: A new feature",
				"fix: A bug fix",
				"docs: Documentation only changes",
				"style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
				"refactor: A code change that neither fixes a bug nor adds a feature",
				"perf: A code change that improves performance",
				"test: Adding missing or correcting existing tests",
				"chore: Changes to the build process or auxiliary tools and libraries such as documentation generation",
			},
			Default: "feat: A new feature",
		},
	},
	{
		Name: "scope",
		Prompt: &survey.Input{
			Message: "Scope of changes (eg. file, function, etc):",
			Suggest: func(toComplete string) []string {
				files, _ := filepath.Glob(toComplete + "*")
				return files
			},
		},
		Validate: func(val interface{}) error {

			if str, ok := val.(string); !ok || len(str) > 25 || len(str) < 2 {
				return errors.New("this response cannot be less than 2 characters and longer than 25 characters")
			}
			return nil
		},
	},
	{
		Name:   "message",
		Prompt: &survey.Input{Message: "Commit message:"},
		Validate: func(val interface{}) error {

			if str, ok := val.(string); !ok || len(str) > 50 || len(str) < 2 {
				return errors.New("this response cannot be less than 2 characters and longer than 50 characters")
			}
			return nil
		},
	},
}

Functions

func AddAllChanges

func AddAllChanges()

func CheckDir

func CheckDir() (bool, error)

func Commit

func Commit(command string)

func GetBranch

func GetBranch() (string, error)

func GetRemote

func GetRemote() ([]string, error)

func Push

func Push(command string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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