setup

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LUA     = "lua"
	SH      = "sh"
	BEFORE  = "before"
	AFTER   = "after"
	LIST    = "list"
	CONFIRM = "confirm"
	INPUT   = "input"
)

Variables

View Source
var ExitCodeStardard map[string]ExitCode = map[string]ExitCode{
	"ExpectedExit": {
		Exception:   "ExpectedExit",
		ExitCode:    0,
		Description: "Expected exit",
	},

	"FileSetupExist": {
		Exception:   "FileSetupExist",
		ExitCode:    1,
		Description: "there is .xconv.yaml configuration in the repository",
	},

	"NotAGitProjectError": {
		Exception:   "NotAGitProjectError",
		ExitCode:    2,
		Description: "not a git repository (or any of the parent directories): .git",
	},

	"NoCommitsFoundError": {
		Exception:   "NoCommitsFoundError",
		ExitCode:    3,
		Description: "no commit found",
	},

	"NoVersionSpecifiedError": {
		Exception:   "NoCommitsFoundError",
		ExitCode:    4,
		Description: "version can not be found in configuration file [.xconv.yaml]",
	},

	"NoPermissionOnDir": {
		Exception:   "NoPermissionOnDir",
		ExitCode:    5,
		Description: ".xconv.yaml file cannot be create in the current directory",
	},

	"BumpRegexInvalid": {
		Exception:   "BumpRegexInvalid",
		ExitCode:    6,
		Description: "bump.pattern in .xconv.yaml invalid",
	},
	"GitNotFound": {
		Exception:   "GitNotFound",
		ExitCode:    7,
		Description: "git not found!. visit <https://git-scm.com/> to install",
	},

	"NothingToCommitError": {
		Exception:   "NothingToCommitError",
		ExitCode:    11,
		Description: "nothing in staging to be committed",
	},

	"MissingConfigError": {
		Exception:   "MissingConfigError",
		ExitCode:    15,
		Description: "configuration missed for .xconv.yaml",
	},

	"CurrentVersionNotFoundError": {
		Exception:   "CurrentVersionNotFoundError",
		ExitCode:    17,
		Description: "current version cannot be found in version_files",
	},

	"InvalidConfigurationError": {
		Exception:   "InvalidConfigurationError",
		ExitCode:    19,
		Description: "an error was found in the xconv configuration",
	},

	"NoneIncrementExit": {
		Exception:   "InvalidConfigurationError",
		ExitCode:    21,
		Description: "the commits found are not elegible to be bumped",
	},

	"InvalidScriptFilter": {
		Exception:   "InvalidScriptFilter",
		ExitCode:    22,
		Description: "an error was found in the script",
	},
	"InvalidProfile": {
		Exception:   "InvalidProfile",
		ExitCode:    23,
		Description: "profiles have recursive inheritance",
	},
	"ActiveProfileNotFound": {
		Exception:   "ActiveProfileNotFound",
		ExitCode:    24,
		Description: "active profiles not found in .xconv.yaml",
	},
}

https://github.com/commitizen-tools/commitizen/blob/master/docs/exit_codes.md

View Source
var Filename string = ".xconv.yaml"
View Source
var XCONVFileContent []byte
View Source
var XCONVInitialtContent []byte

Functions

This section is empty.

Types

type Bump added in v0.12.0

type Bump struct {
	Map     map[string]string `yaml:"map"`
	Pattern string            `yaml:"pattern"`
}

type Configuration

type Configuration struct {
	Rule   Rule   `yaml:"rule"`
	Script Script `yaml:"script"`
}

func NewConfiguration

func NewConfiguration() Configuration

type ExitCode

type ExitCode struct {
	Exception   string
	ExitCode    int
	Description string
}

type Filter

type Filter struct {
	ScriptBase `yaml:",inline"`
	Retry      bool    `yaml:"retry"`
	Message    Message `yaml:"message"`
}

func (Filter) Run

func (filter Filter) Run(args ...string) bool

type Message

type Message struct {
	Content string `yaml:"content"`
	Color   bool   `yaml:"color"`
}

type Middleware

type Middleware struct {
	ScriptBase `yaml:",inline"`
}

func (Middleware) Run

func (middleware Middleware) Run(args ...string) string

type Option

type Option struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
	Name  string `yaml:"name"`
}

type Profile

type Profile struct {
	Bump            Bump       `yaml:"bump"`
	Name            string     `yaml:"name"`
	CommitParser    string     `yaml:"commit_parser"`
	ChangeTypeOrder []string   `yaml:"change_type_order"`
	Example         string     `yaml:"example"`
	MessageTemplate string     `yaml:"message_template"`
	Questions       []Question `yaml:"questions"`
	Schema          string     `yaml:"schema"`
	Tag             Tag        `yaml:"tag"`
	Extends         string     `yaml:"extends"`
	// contains filtered or unexported fields
}

type Question

type Question struct {
	Type       string   `yaml:"type"`
	Message    string   `yaml:"message"`
	Name       string   `yaml:"name"`
	Default    string   `yaml:"default"`
	Middleware []string `yaml:"middleware"`
	Filter     string   `yaml:"filter"`
	Editor     bool     `yaml:"editor"`
	Choices    []Option `yaml:"choices"`
}

type Rule

type Rule struct {
	Version       string    `yaml:"version"`
	ActiveProfile string    `yaml:"active_profile"`
	ChangelogFile string    `yaml:"changelog_file"`
	Profiles      []Profile `yaml:"profiles"`
}

func NewRule

func NewRule() Rule

func (*Rule) FindCurrentProfileEnable

func (rule *Rule) FindCurrentProfileEnable() (Profile, error)

func (*Rule) FindProfileByName added in v0.12.0

func (rule *Rule) FindProfileByName(profileName string) (Profile, bool)

func (*Rule) ReplaceProfile added in v0.12.0

func (rule *Rule) ReplaceProfile(p Profile) error

type Script

type Script struct {
	Ignore     []string     `yaml:"ignore"`
	Filter     []Filter     `yaml:"filters"`
	Middleware []Middleware `yaml:"middlewares"`
	Task       []Task       `yaml:"tasks"`
}

func NewScript

func NewScript() Script

func (*Script) FindAllFilters

func (sc *Script) FindAllFilters() map[string]Filter

func (*Script) FindAllMiddlewares

func (sc *Script) FindAllMiddlewares() map[string]Middleware

func (*Script) FindByFilterName

func (sc *Script) FindByFilterName(name string) (Filter, bool)

func (*Script) FindByMiddlewareName

func (sc *Script) FindByMiddlewareName(name string) (Middleware, bool)

type ScriptBase

type ScriptBase struct {
	Name   string `yaml:"name"`
	Enable bool   `yaml:"enable"`
	Script string `yaml:"script"`
	Type   string `yaml:"type"`
}

type Tag

type Tag struct {
	Stamp  string `yaml:"stamp"`
	Format string `yaml:"format"`
	Mode   string `yaml:"mode"`
}

type Task

type Task struct {
	ScriptBase `yaml:",inline"`
	Bind       string `yaml:"bind"`
	Language   string `yaml:"language"`
	When       string `yaml:"when"`
}

func (Task) Run

func (task Task) Run(args ...string)

Jump to

Keyboard shortcuts

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