Name | commit-msg-git-hook JSON |
Version |
0.4.0
JSON |
| download |
home_page | |
Summary | A set of tools to validate git Conventional Commit messages. |
upload_time | 2024-03-06 18:38:42 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.7 |
license | |
keywords |
ci
commit-msg
git
git hook
git-hook
scan
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Commit Message Git Hook
A set of tools to validate git Conventional Commit messages.
See the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/).
**NOTE**: It doesn't affect any previous commit on your repository.
## Installation Instructions
### Install from PyPI (Python Package Index)
Run the script below to install the latest version of this package:
```bash
pip install commit-msg-git-hook --upgrade
```
### Setup the Local Git Hook `commit-msg`
Run one of the scripts below to scaffold the hook:
- For Linux and macOS:
```bash
python3 -m commit_msg_git_hook.setup
```
- For Windows:
```bash
python -m commit_msg_git_hook.setup
```
It does the following steps:
- Reads and then shows the type of your Operating System.
- Exits with an error message if the OS is unsupported.
- Creates a directory for git-hooks, by default `./.github/git-hooks`.
- Creates subdirectories for each of the supported OS's.
- Creates the `commit-msg` hook file for each OS if it doesn't exist.
- Fills it with a basic script to call `commit_msg.main()`, from this package.
- If the OS is Linux or macOS, makes the hook file executable.
- Sets the hooks (relative) path to the current repository as the directory respective to the OS type (for example: `./.github/git-hooks/linux`).
- Creates a configuration file `commit-msg.config.json` if it doesn't exist.
- Ends with a success message referencing again the type of your OS.
## Configuration Instructions
Customize the configuration file `commit-msg.config.json` to fit your project's needs.
Probably you will want to add **scopes**, to fully utilize the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/).
## Basic Usage
After setting up and adding the new files to your git remote repository, your collaborators will
need to run the **installation** and **setup** steps again.
But, this time, the setup will only set the hooks path and make sure the file `commit-msg` is
executable.
Every time you make a commit, the hook will check if its message is in accordance to the
specification and the project's customization.
## How To Edit Commits
If your branch is not shared yet (not merged into `develop`, for example), you can edit your commits
with the command below. Git will list the last `n` commits and ask you whether you want to keep or
edit each one of them.
```bash
git rebase -i HEAD~n
```
More information here: https://docs.github.com/pt/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message
## Credits
This package was created from a **Craicoverflow** tutorial.
See the tutorial at the link:
https://dev.to/craicoverflow/enforcing-conventional-commits-using-git-hooks-1o5p
Raw data
{
"_id": null,
"home_page": "",
"name": "commit-msg-git-hook",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "ci,commit-msg,git,git hook,git-hook,scan",
"author": "",
"author_email": "Lucio Meira David <lucio.meira@om30.com.br>",
"download_url": "https://files.pythonhosted.org/packages/47/45/04bf14c68fe98edf6ac701612d75ce396b1a86c4a3fb945f0a3ad8e639b0/commit_msg_git_hook-0.4.0.tar.gz",
"platform": null,
"description": "# Commit Message Git Hook\n\nA set of tools to validate git Conventional Commit messages.\n\nSee the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/).\n\n**NOTE**: It doesn't affect any previous commit on your repository.\n\n## Installation Instructions\n\n### Install from PyPI (Python Package Index)\n\nRun the script below to install the latest version of this package:\n\n```bash\npip install commit-msg-git-hook --upgrade\n```\n\n### Setup the Local Git Hook `commit-msg`\n\nRun one of the scripts below to scaffold the hook:\n\n- For Linux and macOS:\n```bash\npython3 -m commit_msg_git_hook.setup\n```\n\n- For Windows:\n```bash\npython -m commit_msg_git_hook.setup\n```\n\nIt does the following steps:\n\n- Reads and then shows the type of your Operating System.\n - Exits with an error message if the OS is unsupported.\n- Creates a directory for git-hooks, by default `./.github/git-hooks`.\n - Creates subdirectories for each of the supported OS's.\n - Creates the `commit-msg` hook file for each OS if it doesn't exist.\n - Fills it with a basic script to call `commit_msg.main()`, from this package.\n - If the OS is Linux or macOS, makes the hook file executable.\n- Sets the hooks (relative) path to the current repository as the directory respective to the OS type (for example: `./.github/git-hooks/linux`).\n- Creates a configuration file `commit-msg.config.json` if it doesn't exist.\n- Ends with a success message referencing again the type of your OS.\n\n## Configuration Instructions\n\nCustomize the configuration file `commit-msg.config.json` to fit your project's needs.\n\nProbably you will want to add **scopes**, to fully utilize the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/).\n\n## Basic Usage\n\nAfter setting up and adding the new files to your git remote repository, your collaborators will\nneed to run the **installation** and **setup** steps again.\nBut, this time, the setup will only set the hooks path and make sure the file `commit-msg` is\nexecutable.\n\nEvery time you make a commit, the hook will check if its message is in accordance to the\nspecification and the project's customization.\n\n## How To Edit Commits\n\nIf your branch is not shared yet (not merged into `develop`, for example), you can edit your commits\nwith the command below. Git will list the last `n` commits and ask you whether you want to keep or\nedit each one of them.\n\n```bash\ngit rebase -i HEAD~n\n```\n\nMore information here: https://docs.github.com/pt/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message\n\n## Credits\n\nThis package was created from a **Craicoverflow** tutorial.\n\nSee the tutorial at the link:\nhttps://dev.to/craicoverflow/enforcing-conventional-commits-using-git-hooks-1o5p",
"bugtrack_url": null,
"license": "",
"summary": "A set of tools to validate git Conventional Commit messages.",
"version": "0.4.0",
"project_urls": {
"Bug Tracker": "https://github.com/OM30/commit-msg-git-hook-package/issues",
"Homepage": "https://github.com/OM30/commit-msg-git-hook-package"
},
"split_keywords": [
"ci",
"commit-msg",
"git",
"git hook",
"git-hook",
"scan"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "037ee6dd8b54d9c0a5e3802b18fb582e1843c368c48ede7833bf1b3284c7a6a2",
"md5": "885f75ab537ad440d3179ccd3c7f8dc6",
"sha256": "8977be4c441be9beb56770d0127a66b2e5146d16c591144d110bf0c2507ee273"
},
"downloads": -1,
"filename": "commit_msg_git_hook-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "885f75ab537ad440d3179ccd3c7f8dc6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7140,
"upload_time": "2024-03-06T18:38:41",
"upload_time_iso_8601": "2024-03-06T18:38:41.655156Z",
"url": "https://files.pythonhosted.org/packages/03/7e/e6dd8b54d9c0a5e3802b18fb582e1843c368c48ede7833bf1b3284c7a6a2/commit_msg_git_hook-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "474504bf14c68fe98edf6ac701612d75ce396b1a86c4a3fb945f0a3ad8e639b0",
"md5": "069bbac6d38c3eec433d9cf18ce9f56c",
"sha256": "7b3423b52db3ac8d88146d8df55371f489748f83a3e8dc9c4dd1d215104798d0"
},
"downloads": -1,
"filename": "commit_msg_git_hook-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "069bbac6d38c3eec433d9cf18ce9f56c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4865,
"upload_time": "2024-03-06T18:38:42",
"upload_time_iso_8601": "2024-03-06T18:38:42.799297Z",
"url": "https://files.pythonhosted.org/packages/47/45/04bf14c68fe98edf6ac701612d75ce396b1a86c4a3fb945f0a3ad8e639b0/commit_msg_git_hook-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-06 18:38:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OM30",
"github_project": "commit-msg-git-hook-package",
"github_not_found": true,
"lcname": "commit-msg-git-hook"
}