Documentation ¶
Index ¶
Constants ¶
const (
CommitChore = "chore" // Other changes
)
Commit types.
const (
DefaultConfigFile = "version.yaml"
)
Default values.
Variables ¶
var ( // ErrConfigWarn is a config warning. ErrConfigWarn = errors.New("config warning") )
Functions ¶
func SetURLFromGit ¶
func SetURLFromGit(u string)
SetURLFromGit sets the remote repository URL from git.
Types ¶
type BumpFile ¶
type BumpFile struct { // File path. File fsys.File `yaml:"file"` // RegExp for string for search version. // If not will be found version regexp in strings from start to end. RegExp []string `yaml:"regexp"` // Start string for search version. Default: 0 (start of file). Start int `yaml:"start"` // End string for search version. If 0 will be searched to end of file. End int `yaml:"end"` }
BumpFile is a file for bump.
func (BumpFile) HasPositions ¶
HasPositions returns true if the file has start and end positions.
func (BumpFile) IsPredefinedJSON ¶
IsPredefinedJSON returns true if the file is predefined (composer.json or package.json). Path contains the file path.
type C ¶
type C struct { // Version is a version of the application. Version version.V `yaml:"version"` // IsFileConfig is a flag that indicates that the configuration is from a file. IsFileConfig bool `yaml:"-"` // BackupChangedFiles is a flag that indicates that the changed files are backed up. Backup bool `yaml:"backupChanged"` // Before is a list of commands that are executed before the main command. Before []Command `yaml:"before"` // After is a list of commands that are executed after the main command. After []Command `yaml:"after"` // GitOptions is a git options. GitOptions gitOptions `yaml:"git"` // ChangelogOptions is a changelog options. ChangelogOptions changelogOptions `yaml:"changelog"` // Bump is a list of files for bump. Bump []BumpFile `yaml:"bump"` // contains filtered or unexported fields }
C is a configuration file.
func (C) CommandsAfter ¶
CommandsAfter returns a list of commands that are executed after the main command.
func (C) CommandsBefore ¶
CommandsBefore returns a list of commands that are executed before the main command.
func (C) CommitTypes ¶
func (c C) CommitTypes() []CommitName
CommitTypes returns a commit types for changelog.
type Command ¶
type Command struct { // Cmd is a command. // Example: ["go", "build", "-o", "bin/app", "."] Cmd []string `yaml:"cmd"` // Flag to send bumped version in format 1.2.3 to command. Optional. VersionFlag string `yaml:"versionFlag"` // BreakOnError is a flag that indicates that the command is stopped if an error occurs. BreakOnError bool `yaml:"breakOnError"` // RunInDry is a flag that indicates that the command is run in dry mode. RunInDry bool `yaml:"runInDry"` }
Command is a command for run before or after git commit.
type CommitName ¶
CommitName is a commit type name.
type LoadArgs ¶ added in v1.0.10
type LoadArgs struct {
RW configRW
}
LoadArgs is a load configuration arguments.
type Options ¶
type Options struct { WorkDir string Version string AllowCommitDirty bool AutoGenerateNextPatch bool AllowDowngrades bool GenerateChangelog bool ChangelogFileName string ChangelogTitle string ChangelogIssueHref string ChangelogShowAuthor bool ChangelogShowBody bool Silent bool DryRun bool Backup bool Force bool Verbose bool ConfigFile string TestingSkipDIInit bool }
Options is a configuration options.