# π Conventional Commits Check
![PyPI Version](https://img.shields.io/pypi/v/conventional-commits-check)
![License](https://img.shields.io/github/license/AliYmn/conventional-commits-check)
![Last Commit](https://img.shields.io/github/last-commit/AliYmn/conventional-commits-check)
![Issues](https://img.shields.io/github/issues/AliYmn/conventional-commits-check)
![Stars](https://img.shields.io/github/stars/AliYmn/conventional-commits-check?style=social)
![Forks](https://img.shields.io/github/forks/AliYmn/conventional-commits-check?style=social)
![Downloads](https://img.shields.io/pypi/dm/conventional-commits-check)
![Contributors](https://img.shields.io/github/contributors/AliYmn/conventional-commits-check)
![Result Image](https://raw.githubusercontent.com/AliYmn/conventional-commits-check/master/images/demo.png)
`conventional-commits-check` is a powerful and easy-to-use Python pre-commit hook that helps enforce [Conventional Commits](https://www.conventionalcommits.org/) rules on your commit messages. It supports adding relevant emojis based on your commit types to enhance readability and bring some fun to your commit history! π
## π What are Conventional Commits?
Conventional Commits provide a lightweight convention for creating a clear and explicit commit history. By using this hook, you'll ensure that your commit messages follow this convention, making your versioning easier to manage and your collaboration more seamless.
## π‘ Features
- β
Enforces Conventional Commits rules on your commit messages.
- π¨ Optionally adds context-specific emojis to the start of commit messages.
- π Blocks commits that do not conform to the Conventional Commits standard.
- π§ Allows for **custom commit types** and **custom emojis** via configuration.
- π **Auto-Merge Commit Handling**: Automatically formats auto-merge commit messages to follow a consistent style.
## π Auto-Merge Commit Handling
The `conventional-commits-check` tool includes functionality to handle auto-merge commit messages. When a commit message matches the pattern "Merge branch '...' into '...'", it is automatically reformatted to a more consistent style, such as "merge: branch '...' into '...'". If emojis are enabled, a π emoji is prepended to the message. This feature ensures that even auto-generated commit messages maintain a clean and readable format.
## π§ Customization
You can customize the commit types and their associated emojis by modifying the `commit_types.py` and `commits_check_config.yaml` files. These files allow you to define additional commit types and specify emojis for each type.
### Example : [`commit_types.py`](https://github.com/AliYmn/conventional-commits-check/blob/master/conventional_commits_check/commit_types.py)
```python
commit_types = {
"access": {
"description": "Improve accessibility.",
"emoji": "βΏοΈ"
},
"analytics": {
"description": "Add or update analytics or track code.",
"emoji": "π"
},
"animation": {
"description": "Add or update animations and transitions.",
"emoji": "π«"
},
"arch": {
"description": "Make architectural changes.",
"emoji": "ποΈ"
},
"assets": {
"description": "Add or update assets.",
"emoji": "π±"
},
"beer": {
"description": "Write code drunkenly.",
"emoji": "π»"
},
# ... more commit types ...
}
```
### Customizing Existing Emojis
You can also modify the emojis for existing commit types by updating the `commits_check_config.yaml`:
```yaml
additional_commit_types:
feat:
description: Introduce new features.
emoji: π
fix:
description: Fix a bug.
emoji: π οΈ
```
## βοΈ Installation
To add `conventional-commits-check` to your project, follow these steps:
1. **Update your `.pre-commit-config.yaml`:**
In your projectβs root directory, add the following:
```yaml
repos:
- repo: https://github.com/AliYmn/conventional-commits-check
rev: v2.9.0 # Use the latest release version
hooks:
- id: conventional-commits-check
stages: [commit-msg]
args: ["--emoji-disabled"] # Use this argument to disable emojis
```
2. **Install the pre-commit hook:**
```bash
pre-commit install --hook-type commit-msg -f
```
3. **Install the `conventional-commits-check` package:**
```bash
pip install -U conventional-commits-check
```
4. **Optional:** Update the pre-commit package:
```bash
pre-commit autoupdate
```
## π Usage
Once the hook is added, it will automatically run each time you make a commit. The hook checks your commit message against Conventional Commits rules, optionally adds the appropriate emoji, and prevents non-conforming commits.
## π¨βπ» Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to enhance `conventional-commits-check`. Letβs make commits fun and consistent! π
## π License
This project is licensed under the [MIT License](LICENSE).
---
Enhance your workflow and bring some life to your commits with `conventional-commits-check`! πβ¨π
Raw data
{
"_id": null,
"home_page": "https://github.com/AliYmn/conventional-commits-check",
"name": "conventional-commits-check",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Ali Yaman",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a9/e3/805339509a69f9e48d698c1860b39498808d2f6980172154152b8a2219c1/conventional_commits_check-2.9.0.tar.gz",
"platform": null,
"description": "# \ud83c\udf89 Conventional Commits Check\n\n![PyPI Version](https://img.shields.io/pypi/v/conventional-commits-check)\n![License](https://img.shields.io/github/license/AliYmn/conventional-commits-check)\n![Last Commit](https://img.shields.io/github/last-commit/AliYmn/conventional-commits-check)\n![Issues](https://img.shields.io/github/issues/AliYmn/conventional-commits-check)\n![Stars](https://img.shields.io/github/stars/AliYmn/conventional-commits-check?style=social)\n![Forks](https://img.shields.io/github/forks/AliYmn/conventional-commits-check?style=social)\n![Downloads](https://img.shields.io/pypi/dm/conventional-commits-check)\n![Contributors](https://img.shields.io/github/contributors/AliYmn/conventional-commits-check)\n\n![Result Image](https://raw.githubusercontent.com/AliYmn/conventional-commits-check/master/images/demo.png)\n\n`conventional-commits-check` is a powerful and easy-to-use Python pre-commit hook that helps enforce [Conventional Commits](https://www.conventionalcommits.org/) rules on your commit messages. It supports adding relevant emojis based on your commit types to enhance readability and bring some fun to your commit history! \ud83d\ude80\n\n## \ud83d\udcdc What are Conventional Commits?\n\nConventional Commits provide a lightweight convention for creating a clear and explicit commit history. By using this hook, you'll ensure that your commit messages follow this convention, making your versioning easier to manage and your collaboration more seamless.\n\n## \ud83d\udca1 Features\n\n- \u2705 Enforces Conventional Commits rules on your commit messages.\n- \ud83c\udfa8 Optionally adds context-specific emojis to the start of commit messages.\n- \ud83d\uded1 Blocks commits that do not conform to the Conventional Commits standard.\n- \ud83d\udd27 Allows for **custom commit types** and **custom emojis** via configuration.\n- \ud83d\udd04 **Auto-Merge Commit Handling**: Automatically formats auto-merge commit messages to follow a consistent style.\n\n## \ud83d\udd04 Auto-Merge Commit Handling\n\nThe `conventional-commits-check` tool includes functionality to handle auto-merge commit messages. When a commit message matches the pattern \"Merge branch '...' into '...'\", it is automatically reformatted to a more consistent style, such as \"merge: branch '...' into '...'\". If emojis are enabled, a \ud83c\udf89 emoji is prepended to the message. This feature ensures that even auto-generated commit messages maintain a clean and readable format.\n\n## \ud83d\udd27 Customization\n\nYou can customize the commit types and their associated emojis by modifying the `commit_types.py` and `commits_check_config.yaml` files. These files allow you to define additional commit types and specify emojis for each type.\n\n### Example : [`commit_types.py`](https://github.com/AliYmn/conventional-commits-check/blob/master/conventional_commits_check/commit_types.py)\n\n```python\ncommit_types = {\n \"access\": {\n \"description\": \"Improve accessibility.\",\n \"emoji\": \"\u267f\ufe0f\"\n },\n \"analytics\": {\n \"description\": \"Add or update analytics or track code.\",\n \"emoji\": \"\ud83d\udcc8\"\n },\n \"animation\": {\n \"description\": \"Add or update animations and transitions.\",\n \"emoji\": \"\ud83d\udcab\"\n },\n \"arch\": {\n \"description\": \"Make architectural changes.\",\n \"emoji\": \"\ud83c\udfd7\ufe0f\"\n },\n \"assets\": {\n \"description\": \"Add or update assets.\",\n \"emoji\": \"\ud83c\udf71\"\n },\n \"beer\": {\n \"description\": \"Write code drunkenly.\",\n \"emoji\": \"\ud83c\udf7b\"\n },\n # ... more commit types ...\n}\n```\n\n### Customizing Existing Emojis\n\nYou can also modify the emojis for existing commit types by updating the `commits_check_config.yaml`:\n\n```yaml\nadditional_commit_types:\n feat:\n description: Introduce new features.\n emoji: \ud83c\udf89\n fix:\n description: Fix a bug.\n emoji: \ud83d\udee0\ufe0f\n```\n\n## \u2699\ufe0f Installation\n\nTo add `conventional-commits-check` to your project, follow these steps:\n\n1. **Update your `.pre-commit-config.yaml`:**\n\n In your project\u2019s root directory, add the following:\n\n ```yaml\n repos:\n - repo: https://github.com/AliYmn/conventional-commits-check\n rev: v2.9.0 # Use the latest release version\n hooks:\n - id: conventional-commits-check\n stages: [commit-msg]\n args: [\"--emoji-disabled\"] # Use this argument to disable emojis\n ```\n\n2. **Install the pre-commit hook:**\n\n ```bash\n pre-commit install --hook-type commit-msg -f\n ```\n\n3. **Install the `conventional-commits-check` package:**\n\n ```bash\n pip install -U conventional-commits-check\n ```\n\n4. **Optional:** Update the pre-commit package:\n\n ```bash\n pre-commit autoupdate\n ```\n\n## \ud83d\ude80 Usage\n\nOnce the hook is added, it will automatically run each time you make a commit. The hook checks your commit message against Conventional Commits rules, optionally adds the appropriate emoji, and prevents non-conforming commits.\n\n## \ud83d\udc68\u200d\ud83d\udcbb Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests to enhance `conventional-commits-check`. Let\u2019s make commits fun and consistent! \ud83d\ude04\n\n## \ud83d\udcdc License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\nEnhance your workflow and bring some life to your commits with `conventional-commits-check`! \ud83c\udf89\u2728\ud83d\udc1b\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A pre-commit hook to check Conventional Commits and add emojis.",
"version": "2.9.0",
"project_urls": {
"Homepage": "https://github.com/AliYmn/conventional-commits-check"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d0ca9354317f115714f410d8c3fd9e2c9a6e85f5b24d4ff24bad6d305f5975f8",
"md5": "dafb0fc639b98afc937188c8fbba2c7d",
"sha256": "c2864cb3f6d9c921d0c035c3c45254bcb8d4a70c50bc531ef515032dea6178dc"
},
"downloads": -1,
"filename": "conventional_commits_check-2.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dafb0fc639b98afc937188c8fbba2c7d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9729,
"upload_time": "2024-11-18T11:49:51",
"upload_time_iso_8601": "2024-11-18T11:49:51.562792Z",
"url": "https://files.pythonhosted.org/packages/d0/ca/9354317f115714f410d8c3fd9e2c9a6e85f5b24d4ff24bad6d305f5975f8/conventional_commits_check-2.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a9e3805339509a69f9e48d698c1860b39498808d2f6980172154152b8a2219c1",
"md5": "77cd38a721d26b5814c52887cc441e8f",
"sha256": "6b58af0c424994ae63102715936bfc3027edc9a17d2017c19a1753da9250790c"
},
"downloads": -1,
"filename": "conventional_commits_check-2.9.0.tar.gz",
"has_sig": false,
"md5_digest": "77cd38a721d26b5814c52887cc441e8f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8596,
"upload_time": "2024-11-18T11:49:52",
"upload_time_iso_8601": "2024-11-18T11:49:52.346471Z",
"url": "https://files.pythonhosted.org/packages/a9/e3/805339509a69f9e48d698c1860b39498808d2f6980172154152b8a2219c1/conventional_commits_check-2.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 11:49:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AliYmn",
"github_project": "conventional-commits-check",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "conventional-commits-check"
}