Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.38 KB

README.md

File metadata and controls

44 lines (34 loc) · 1.38 KB

PyRust Task ID

PyRust Task ID MIT GitHub Actions Workflow Status

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.
Then you can just use this tool.

First, just add hook into .pre-commit-config.yaml:

-   repo: https://github.com/vanya909/pyrust-task-id-pre-commit
    rev: 0.1.5
    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

pre-commit install --hook-type "commit-msg"

Then commit

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 for pre-commit hook because it requires pre-build python wheels from PyPI