commit-msg-git-hook


Namecommit-msg-git-hook JSON
Version 0.5.2 PyPI version JSON
download
home_pageNone
SummaryA set of tools to validate git Conventional Commit messages.
upload_time2024-05-02 21:18:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
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": null,
    "name": "commit-msg-git-hook",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "ci, commit-msg, git, git hook, git-hook, scan",
    "author": null,
    "author_email": "Lucio Meira David <lucio.meira@om30.com.br>",
    "download_url": "https://files.pythonhosted.org/packages/39/65/5f853855bff6d510cd12f539254e43804ca11976c01ce608f0829e64d0a5/commit_msg_git_hook-0.5.2.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": null,
    "summary": "A set of tools to validate git Conventional Commit messages.",
    "version": "0.5.2",
    "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": "7c6a82d3f462d4c5e77b828b54d411de32edd5d977b0c17ec0618572ab084e05",
                "md5": "c9db8694c51f4355b92f85c957e6efcd",
                "sha256": "5f343556e548df044d0916b1a23a0e4e8fd6bb185bfae4875d17a17c8bf05764"
            },
            "downloads": -1,
            "filename": "commit_msg_git_hook-0.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9db8694c51f4355b92f85c957e6efcd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12222,
            "upload_time": "2024-05-02T21:18:25",
            "upload_time_iso_8601": "2024-05-02T21:18:25.452924Z",
            "url": "https://files.pythonhosted.org/packages/7c/6a/82d3f462d4c5e77b828b54d411de32edd5d977b0c17ec0618572ab084e05/commit_msg_git_hook-0.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39655f853855bff6d510cd12f539254e43804ca11976c01ce608f0829e64d0a5",
                "md5": "6db89623d13c331285b61d92388decfe",
                "sha256": "72db74e624c9cf6512e710119cba5b506b641df36c29ed5c6ae7b7eac8505feb"
            },
            "downloads": -1,
            "filename": "commit_msg_git_hook-0.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6db89623d13c331285b61d92388decfe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6398,
            "upload_time": "2024-05-02T21:18:27",
            "upload_time_iso_8601": "2024-05-02T21:18:27.416107Z",
            "url": "https://files.pythonhosted.org/packages/39/65/5f853855bff6d510cd12f539254e43804ca11976c01ce608f0829e64d0a5/commit_msg_git_hook-0.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 21:18:27",
    "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"
}
        
Elapsed time: 0.35702s