Metadata-Version: 2.4
Name: pyrust_task_id
Version: 0.1.4
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
License-File: LICENSE
Summary: Tool to provide task id, retrieved from branch name, right into commit message.
Keywords: rust,python,ticket,task,branch,commit,auto,pre-commit,retrieve,pull,parse,jira,hook
Author-email: Ivan Studinsky <vanya909x75@gmail.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/vanya909/pyrust-task-id
Project-URL: Issues, https://github.com/vanya909/pyrust-task-id/issues
Project-URL: Pre-commit hook, https://github.com/vanya909/pyrust-task-id-pre-commit

# PyRust Task ID
![PyRust Task ID](https://img.shields.io/pypi/v/pyrust-task-id?label=pyrust-task-id)
![MIT](https://img.shields.io/badge/license-MIT-blue)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/vanya909/pyrust-task-id/.github%2Fworkflows%2FCI.yml)


A written in Rust tool for Python programs that automatically pull task id from branch name to commit message.

## Example
Let's imagine you have branch `project_name/TASK-111-implement-feature` and you need
to provide the task `TASK-111` into commit message.<br>Then you can just use this tool.

First, just add hook into `.pre-commit-config.yaml`:
```yaml
-   repo: https://github.com/vanya909/pyrust-task-id-pre-commit
    rev: 0.1.4
    hooks:
    -   id: pyrust-task-id
        stages: [commit-msg]
        args:
        -   "project_name/(?P<task_template>TASK-[0-9]{3})-.*"
        -   "{subject}\\n\\n{body}\\n\\nTask ID: {task_id}"
```

Then run
```bash
pre-commit install --hook-type "commit-msg"
```

Then commit
```bash
git commit -m"My cool feature" -m"Can't wait to see this feature in prod."
```

And then you'll see following commit message:
```
My cool feature

Can't wait to see this feature in prod.

Task ID: TASK-111
```

This project uses [standalone repo](https://github.com/vanya909/pyrust-task-id-pre-commit) for pre-commit hook because it requires pre-build python wheels from PyPI

