Skip to main content

cz-bitbucket-jira-plugin

A Commitizen plugin that links your Bitbucket commits with your Jira issues.

GIF

Installation

pip install cz-bitbucket-jira-plugin

Configuration

Theres 2 possible configuration files: pyproject.toml and cz.toml. It's up to you.

The only required configurations are:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
jira_url = "https://<project name>.atlassian.net"

This tells Commitizen which plugin you want to use and what is your Jira url, to properly link issues on commit messages and Changelog.

Jira project key (optional)

To avoid the need to type your Jira project key for every commit, you can set this up in your chosen configuration file:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
jira_project_key = "DEV"

Now every time you execute cz commit, Commitizen will use the cz-bitbucket-jira-plugin and use "DEV" as your default Jira project key.

Minimum length for commit messages (optional)

You can set a minimum length for commit messages to prevent things like "fix", "wip", "test", "aaa", and so on...

To do this, set this up in your chosen configuration file:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
commit_message_minimum_length = 32

The default value for this config is 32.

Usage

As it is a Commitizen plugin, you can:

cz

Customization

You can change some defaults of the plugin:

Prompt style

To change the default prompt style which is:

prompt_style = [
    { identifier = "qmark", style = "fg:#FF5555" },
    { identifier = "question", style = "fg:#BD93F9" },
    { identifier = "answer", style = "fg:#F8F8F2 nobold" },
    { identifier = "pointer", style = "fg:#50FA7B nobold" },
    { identifier = "highlighted", style = "fg:#50FA7B" },
    { identifier = "selected", style = "fg:#50FA7B" },
    { identifier = "separator", style = "fg:#858585" },
    { identifier = "instruction", style = "fg:#858585 nobold" },
    { identifier = "text", style = "fg:#F8F8F2" },
    { identifier = "disabled", style = "fg:#858585 italic" },
]

You can create the prompt_style key in your config file. This key must be an array of inline tables. Each inline table must have two pair of key/value.

Example:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
prompt_style = [
    { identifier = "question", style = "fg:#50FA7B bold" },
    { identifier = "answer", style = "fg:#F8F8F2 nobold" }
]

The available identifiers are:

  • qmark
  • question
  • answer
  • pointer
  • highlighted
  • selected
  • separator
  • instruction
  • text
  • disabled

You can check this also on https://questionary.readthedocs.io/en/stable/pages/advanced.html#themes-styling

For the complete styling documentation check https://python-prompt-toolkit.readthedocs.io/en/stable/pages/advanced_topics/styling.html

Commit types

To change the default commit types which is:

commit_types = [
    { value = "init", name = "init: initial commit to set up your repository" },
    { value = "feat", name = "feat: introduce a new feature" },
    { value = "fix", name = "fix: fix a bug" },
    { value = "docs", name = "docs: add or update documentation" },
    { value = "typo", name = "typo: fix typos" },
    { value = "refactor", name = "refactor: code refactoring" },
    { value = "perf", name = "perf: code refactoring that improves performance" },
    { value = "delete", name = "delete: code or file deletion" },
    { value = "test", name = "test: add or update tests" },
    { value = "misc", name = "misc: changes that do not affect the code itself (e.g.: add .gitignore)" },
    { value = "style", name = "style: changes on code styling (e.g.: formatting, white-spaces)" }
]

You can create the commit_types key in your config file. This key must be an array of inline tables. Each inline table must have two pair of key/value, and the key names must be: value and name. Must be these names (at least for now).

Example:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
commit_types = [
    { value = "feat", name = "feat: introduce a new feature" },
    { value = "fix", name = "fix: fix a bug" },
    { value = "refactor", name = "refactor: code refactoring" }
]

Change type map

Array of inline tables that have an key map for each commit type. Using the commit types on the example above:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
change_type_map = [
    { value = "feat", name = "New features" },
    { value = "fix", name = "Bug fixes" },
    { value = "refactor", name = "Code refactoring" }
]

The value are the commit type and name are the long name that will appear in the Changelog.

Change type order

Array containing the order you want to show in the Changelog.

If you think that bug fixes are more important than new features you can show them first on Changelog:

[tool.commitizen]
name = "cz-bitbucket-jira-plugin"
change_type_order = [
    "Bug fixes",
    "New features",
    "Code refactoring"
]

Metadata

Release files for cz-bitbucket-jira-plugin 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cz-bitbucket-jira-plugin 1.0.0
File Size Uploaded
cz_bitbucket_jira_plugin-1.0.0.tar.gz 124.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cz-bitbucket-jira-plugin 1.0.0
File Interpreter ABI Platform
cz_bitbucket_jira_plugin-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 135.7 kB

Release files / cz_bitbucket_jira_plugin-1.0.0.tar.gz

Download URL cz_bitbucket_jira_plugin-1.0.0.tar.gz
Size 124.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ba5bbe843c0f8d9f499f91f7fb8a3927872573e1486c737c812245b571df546f
BLAKE2b-256 checksum
How to use checksums
d82e6176443354229d5c0d874c8e073d1e1b3a5fe6dd9dad58b618d04bbfd9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / cz_bitbucket_jira_plugin-1.0.0-py3-none-any.whl

Download URL cz_bitbucket_jira_plugin-1.0.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f131f6b5798460360826f1d14c0929868b00799c561da6858efad9414016dcd4
BLAKE2b-256 checksum
How to use checksums
4231ef7bc6d1040cf4779a48472206c5d51649ff6cdd93df13a5d0a53efc6649
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page