API reference

Every declaration below is extracted from zig-bump's source, with the doc comments as written there. A declaration listed without prose is public but undocumented in the source.

Root

semver

const semver = @import("semver.zig")

SemVer

const SemVer = semver.SemVer

ReleaseType

const ReleaseType = semver.ReleaseType

config

const config = @import("config.zig")

Config

const Config = config.Config

files

const files = @import("files.zig")

FileType

const FileType = files.FileType

FileInfo

const FileInfo = files.FileInfo

git

const git = @import("git.zig")

GitError

const GitError = git.GitError

bump

const bump = @import("bump.zig")

versionBump

const versionBump = bump.versionBump

BumpOptions

const BumpOptions = bump.BumpOptions

BumpResult

const BumpResult = bump.BumpResult

cli

const cli = @import("cli.zig")

CliArgs

const CliArgs = cli.CliArgs

semver

ReleaseType

const ReleaseType = enum

fromString

fn fromString(str: []const u8) ?ReleaseType

SemVer

const SemVer = struct

init

fn init(allocator: Allocator, version_str: []const u8) !SemVer

deinit

fn deinit(self: *SemVer) void

increment

fn increment(self: *SemVer, release_type: ReleaseType, preid: ?[]const u8) !void

toString

fn toString(self: SemVer, allocator: Allocator) ![]u8

isValid

fn isValid(version_str: []const u8) bool

config

Config

const Config = struct

loadFromFile

fn loadFromFile(allocator: Allocator, path: []const u8) !Config

merge

fn merge(base: Config, overrides: Config) Config

deinit

fn deinit(self: *Config, allocator: Allocator) void

findConfigFile

fn findConfigFile(allocator: Allocator) ?[]u8

files

FileType

const FileType = enum

fromPath

fn fromPath(path: []const u8) FileType

isJsonFile

fn isJsonFile(self: FileType) bool

isTomlFile

fn isTomlFile(self: FileType) bool

FileInfo

const FileInfo = struct

init

fn init(allocator: Allocator, path: []const u8) !FileInfo

deinit

fn deinit(self: *FileInfo) void

findVersion

fn findVersion(self: FileInfo, allocator: Allocator) !?[]u8

updateVersion

fn updateVersion(self: *FileInfo, old_version: []const u8, new_version: []const u8) !void

write

fn write(self: FileInfo) !void

findFiles

fn findFiles(allocator: Allocator, dir_path: []const u8, recursive: bool, pattern: ?[]const u8) ![][]u8

git

GitError

const GitError = error

isGitRepository

fn isGitRepository(allocator: Allocator) bool

hasUncommittedChanges

fn hasUncommittedChanges(allocator: Allocator) !bool

getCurrentBranch

fn getCurrentBranch(allocator: Allocator) ![]u8

stageAll

fn stageAll(allocator: Allocator) !void

commit

fn commit(allocator: Allocator, message: []const u8, sign: bool, no_verify: bool) !void

createTag

fn createTag(allocator: Allocator, tag_name: []const u8, message: ?[]const u8, sign: bool) !void

hasRemote

fn hasRemote(allocator: Allocator) !bool

pull

fn pull(allocator: Allocator) !void

push

fn push(allocator: Allocator, follow_tags: bool) !void

getRecentCommits

fn getRecentCommits(allocator: Allocator, count: u32) ![][]u8

getCommitsSinceLastTag

fn getCommitsSinceLastTag(allocator: Allocator) ![][]u8

generateChangelog

fn generateChangelog(allocator: Allocator, version: []const u8) !void

formatCommitMessage

fn formatCommitMessage(allocator: Allocator, version: []const u8, custom_msg: ?[]const u8) ![]u8

bump

BumpOptions

const BumpOptions = struct

BumpResult

const BumpResult = struct

deinit

fn deinit(self: *BumpResult) void

versionBump

fn versionBump(allocator: Allocator, options: BumpOptions) !BumpResult

cli

CliArgs

const CliArgs = struct

deinit

fn deinit(self: *CliArgs, allocator: Allocator) void

parseArgs

fn parseArgs(allocator: Allocator) !CliArgs

printHelp

fn printHelp() void