Configuration reference
The config reference list all value that can be set in the cog.toml
file at the root of a repository.
General
tag_prefix
Type:
String
Optional:
true
Description: set a tag prefix value for cocogitto. For instance if you have a
v
as a tag prefix, cocogitto will generate version starting withv
and commands likecog changelog
will pick only those versions.Example:
tag_prefix = "v"
Also see:
branch_whitelist
Type:
Array<String>
Optional:
true
Description: A list of glob patterns to allow bumping only on matching branches.
Example:
branch_whitelist = [ "main", "release/**" ]
Also see:
ignore_merge_commits
Type:
boolean
Optional:
true
Default:
false
Description: whether to ignore or to lint merge commits.
Example:
ignore_merge_commits = true
Also see:
Commit Types
Type:
Hashmap<String, CommitType>
Optional:
true
Description: extend the allowed commit types, creating a new
cog commit
command and allowing to generate changelog entries for the given type. Can also be used to override the default commit types.Example:
[commit_types] hotfix = { changelog_title = "Hotfixes" } chore = { changelog_title = "Hotfixes", omit_from_changelog = true } release = { changelog_title = "Releases" }
Also see:
changelog_title
- Type:
String
- Optional:
false
- Description: change the changelog title for the given commit type.
- Example:
[commit_types] chore = { changelog_title = "Misc" } hotfix = { changelog_title = "Hot fix" }
omit_from_changelog
- Type:
Bool
- Optional:
true
- Default value:
false
- Description: do not generate changelog entries for the given commit type.
- Example:
[commit_types] chore = { changelog_title = "Chore", omit_from_changelog = true }
Bump config
pre_bump_hooks
Type:
Array<String>
Optional:
true
Description: an array of command to execute before a version bump.
Example:
pre_bump_hooks = [ "sh -c \"./ci/check_branch.sh\"", "cargo test -- --test-threads 1", "cargo clippy", "cargo build --release", "cargo fmt --all", "cargo bump {{version}}", ]
Also see:
post_bump_hooks
Type:
Array<String>
Optional:
true
Description: an array of command to execute after a version bump.
Example:
post_bump_hooks = [ "git push", "git push origin {{version}}", "cargo package", "cargo publish" ]
Also see:
bump_profiles
Type:
Hashmap<String, BumpProfile>
Optional:
true
Description: add additional pre-bump and post-bump hooks profile. a profile can be used with the
cog bump --hook-profile <profile_name>
flag.Example:
[bump_profiles.hotfix] pre_bump_hooks = [ "cargo build --release", "cargo fmt --all", "cargo bump {{version}}", ] post_bump_hooks = [ "cargo package", "cargo publish" ]
Also see:
skip_ci
- Type:
String
- Optional:
true
- Description: A "skip-ci" string to add to the commits when using the
bump
orcommit
commands. Default value is[skip ci]
. - Example:
skip_ci = "[ci-skip]"
- Also see:
skip_untracked
- Type:
boolean
- Optional:
true
- Default value:
false
- Description: Allows to perform bump even if there are untracked or uncommited changes.
- Example:
skip_untracked = true
- Also see:
disable_changelog
- Type:
boolean
- Optional:
true
- Default value:
false
- Description: Disable changelog generation when bumping.
- Example:
disable_changelog = true
Changelog
path
Type:
String
Optional:
true
Default value:
"CHANGELOG.md"
Description: path the repository markdown changelog.
Example:
[changelog] path = "my_changelog.md"
Also see:
template
Type:
String
Optional:
true
Default value:
"default"
Description: name of the builtin template to use for changelog generation or path to a custom template. Note that
remote
,repository
andowner
are mandatory if the "remote" built-in template us used or if your custom template make use of those variables.Built-in templates :
default
,remote
,full_hash
Example:
[changelog] template = "full_hash"
Also see:
remote
Type:
String
Optional:
true
Description: domain name of the git platform hosting the repository, used for Markdown link generation in changelogs. when provided
repository
andowner
are also required.Example:
[changelog] template = "remote" remote = "github.com" repository = "cocogitto" owner = "cocogitto"
Also see:
repository
Type:
String
Optional:
true
Description: name of the repository on the remote git platform.
Example:
[changelog] template = "remote" remote = "github.com" repository = "cocogitto" owner = "cocogitto"
Also see:
owner
Type:
String
Optional:
true
Description: owner of the repository on the remote git platform.
Example:
[changelog] template = "remote" remote = "github.com" repository = "cocogitto" owner = "cocogitto"
Also see:
authors
Type:
Array<Author>
Optional:
true
Description: A list of commit authors with their git signature and git platform username to generate Markdown links in changelogs.
Example:
[changelog] authors = [ { signature = "Paul Delafosse", username = "oknozor" }, { signature = "Jack Dorland", username = "jackdorland" }, { signature = "Mike Lubinets", username = "mersinvald" }, { signature = "Marcin Puc", username = "tranzystorek-io" }, { signature = "Renault Fernandes", username = "renaultfernandes" }, { signature = "Pieter Joost van de Sande", username = "pjvds" }, { signature = "orhun", username = "orhun" }, { signature = "Danny Tatom", username = "its-danny" }, ]
Also see:
Mono-repository config
monorepo_version_separator
- Type:
String
- Optional:
true
- Description: set a package tag separator. For instance if you have a
-
as package separator, cocogitto will generate monorepo package version starting with the package name followed by the optional prefix and package version (ex:my-package-v1.0.0
) - Example:
monorepo_version_separator = "-"
pre_package_bump_hooks
- Type:
Array<String>
- Optional:
true
- Description: an array of command executed before every package bump.
- Example:
pre_bump_hooks = [ "cargo build --release", "cargo fmt --all", "cargo set-version {{version}}", ]
post_package_bump_hooks
- Type:
Array<String>
- Optional:
true
- Description: an array of command executed after every package bump.
- Example:
pre_bump_hooks = [ "cargo build --release", "cargo fmt --all", "cargo set-version {{version}}", ]
Mono-repository packages
path
- Type:
String
- Optional:
false
- Description: set the package path.
- Example:
[packages] my_package = { path = "packages/my_package" }
changelog_path
- Type:
String
- Optional:
true
- Default:
{path}/CHANGELOG.md
- Description: overrides the default changelog path, allowing to set an absolute path.
- Example:
[packages] my_package = { path = "packages/my_package", changelog_path = "changelogs/my_package.md" }
public_api
Type:
boolean
Optional:
true
Default:
true
Description: if set to false package will not trigger global version bump.
Example:
[packages] my_package = { path = "packages/my_package", public_api = false }
Also see:
pre_bump_hooks
Type:
Array<String>
Optional:
true
Description: an array of command to execute before a package bump.
Example:
pre_bump_hooks = [ "cargo build --release", "cargo fmt --all", "cargo set-version {{version}}", ]
Also see:
post_bump_hooks
Type:
Array<String>
Optional:
true
Description: an array of command to execute after a version bump.
Example:
post_bump_hooks = [ "echo {{latest}} bumped to {{version}}", ]
Also see:
bump_profiles
- Type:
Hashmap<String, BumpProfile>
- Optional:
true
- Description: add additional per package pre-bump and post-bump hooks profile. a profile can be used with the
cog bump --hook-profile <profile_name>
flag. - Example:
[packages.my-package] path = "packages/my-package" [bump_profiles.hotfix] pre_bump_hooks = [ "cargo build --release", "cargo fmt --all", "cargo set-version {{version}}", ] post_bump_hooks = [ "cargo package", ]