{"id":14259643,"url":"https://github.com/compilerla/conventional-pre-commit","last_synced_at":"2026-02-18T21:03:26.614Z","repository":{"id":37382499,"uuid":"373397218","full_name":"compilerla/conventional-pre-commit","owner":"compilerla","description":"A pre-commit hook that checks commit messages for Conventional Commits formatting","archived":false,"fork":false,"pushed_at":"2026-01-19T21:00:13.000Z","size":408,"stargazers_count":487,"open_issues_count":4,"forks_count":67,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-20T03:12:19.153Z","etag":null,"topics":["conventional-commits","pre-commit","pre-commit-hook"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compilerla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-03T05:58:13.000Z","updated_at":"2026-01-17T06:57:48.000Z","dependencies_parsed_at":"2026-01-19T23:01:10.511Z","dependency_job_id":null,"html_url":"https://github.com/compilerla/conventional-pre-commit","commit_stats":{"total_commits":155,"total_committers":10,"mean_commits":15.5,"dds":0.5161290322580645,"last_synced_commit":"04a088444c7fc019c9f9c4cea4420b67e3f3dac3"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/compilerla/conventional-pre-commit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilerla%2Fconventional-pre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilerla%2Fconventional-pre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilerla%2Fconventional-pre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilerla%2Fconventional-pre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compilerla","download_url":"https://codeload.github.com/compilerla/conventional-pre-commit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilerla%2Fconventional-pre-commit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conventional-commits","pre-commit","pre-commit-hook"],"created_at":"2024-08-22T10:01:43.841Z","updated_at":"2026-02-18T21:03:26.597Z","avatar_url":"https://github.com/compilerla.png","language":"Python","readme":"# conventional-pre-commit\n\nA [`pre-commit`](https://pre-commit.com) hook to check commit messages for\n[Conventional Commits](https://conventionalcommits.org) formatting.\n\nWorks with Python \u003e= 3.8.\n\n## Usage\n\nMake sure `pre-commit` is [installed](https://pre-commit.com#install).\n\nCreate a blank configuration file at the root of your repo, if needed:\n\n```console\ntouch .pre-commit-config.yaml\n```\n\nAdd/update `default_install_hook_types` and add a new repo entry in your configuration file:\n\n```yaml\ndefault_install_hook_types:\n  - pre-commit\n  - commit-msg\n\nrepos:\n  # - repo: ...\n\n  - repo: https://github.com/compilerla/conventional-pre-commit\n    rev: \u003cgit sha or tag\u003e\n    hooks:\n      - id: conventional-pre-commit\n        stages: [commit-msg]\n        args: []\n```\n\nInstall the `pre-commit` script:\n\n```console\npre-commit install --install-hooks\n```\n\nMake a (normal) commit :x::\n\n```console\n$ git commit -m \"add a new feature\"\n\n[INFO] Initializing environment for ....\nConventional Commit......................................................Failed\n- hook id: conventional-pre-commit\n- duration: 0.07s\n- exit code: 1\n\n[Bad commit message] \u003e\u003e add a new feature\nYour commit message does not follow Conventional Commits formatting\nhttps://www.conventionalcommits.org/\n```\n\nAnd with the `--verbose` arg:\n\n```console\n$ git commit -m \"add a new feature\"\n\n[INFO] Initializing environment for ....\nConventional Commit......................................................Failed\n- hook id: conventional-pre-commit\n- duration: 0.07s\n- exit code: 1\n\n[Bad commit message] \u003e\u003e add a new feature\nYour commit message does not follow Conventional Commits formatting\nhttps://www.conventionalcommits.org/\n\nConventional Commit messages follow a pattern like:\n\n    type(scope): subject\n\n    extended body\n\nPlease correct the following errors:\n\n  - Expected value for type from: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test\n\nRun:\n\n    git commit --edit --file=.git/COMMIT_EDITMSG\n\nto edit the commit message and retry the commit.\n```\n\nMake a (conventional) commit :heavy_check_mark::\n\n```console\n$ git commit -m \"feat: add a new feature\"\n\n[INFO] Initializing environment for ....\nConventional Commit......................................................Passed\n- hook id: conventional-pre-commit\n- duration: 0.05s\n```\n\n## Install with pip\n\n`conventional-pre-commit` can also be installed and used from the command line:\n\n```shell\npip install conventional-pre-commit\n```\n\nThen run the command line script:\n\n```shell\nconventional-pre-commit [types] input\n```\n\n- `[types]` is an optional list of Conventional Commit types to allow (e.g. `feat fix chore`)\n\n- `input` is a file containing the commit message to check:\n\n```shell\nconventional-pre-commit feat fix chore ci test .git/COMMIT_MSG\n```\n\nOr from a Python program:\n\n```python\nfrom conventional_pre_commit.format import is_conventional\n\n# prints True\nprint(is_conventional(\"feat: this is a conventional commit\"))\n\n# prints False\nprint(is_conventional(\"nope: this is not a conventional commit\"))\n\n# prints True\nprint(is_conventional(\"custom: this is a conventional commit\", types=[\"custom\"]))\n```\n\n## Passing `args`\n\n`conventional-pre-commit` supports a number of arguments to configure behavior:\n\n```shell\n$ conventional-pre-commit -h\nusage: conventional-pre-commit [-h] [--no-color] [--force-scope] [--scopes SCOPES] [--strict] [--verbose] [types ...] input\n\nCheck a git commit message for Conventional Commits formatting.\n\npositional arguments:\n  types            Optional list of types to support\n  input            A file containing a git commit message\n\noptions:\n  -h, --help       show this help message and exit\n  --no-color       Disable color in output.\n  --force-scope    Force commit to have scope defined.\n  --scopes SCOPES  List of scopes to support. Scopes should be separated by commas with no spaces (e.g. api,client).\n  --strict         Force commit to strictly follow Conventional Commits formatting. Disallows fixup! and merge commits.\n  --verbose        Print more verbose error output.\n```\n\nSupply arguments on the command-line, or via the pre-commit `hooks.args` property:\n\n```yaml\nrepos:\n  - repo: https://github.com/compilerla/conventional-pre-commit\n    rev: \u003cgit sha or tag\u003e\n    hooks:\n      - id: conventional-pre-commit\n        stages: [commit-msg]\n        args: [--strict, --force-scope, feat, fix, chore, test, custom]\n```\n\n**NOTE:** when using as a pre-commit hook, `input` is supplied automatically (with the current commit's message).\n\n## Development\n\n`conventional-pre-commit` comes with a [VS Code devcontainer](https://code.visualstudio.com/learn/develop-cloud/containers)\nconfiguration to provide a consistent development environment.\n\nWith the `Remote - Containers` extension enabled, open the folder containing this repository inside Visual Studio Code.\n\nYou should receive a prompt in the Visual Studio Code window; click `Reopen in Container` to run the development environment\ninside the devcontainer.\n\nIf you do not receive a prompt, or when you feel like starting from a fresh environment:\n\n1. `Ctrl/Cmd+Shift+P` to bring up the command palette in Visual Studio Code\n1. Type `Remote-Containers` to filter the commands\n1. Select `Rebuild and Reopen in Container` to completely rebuild the devcontainer\n1. Select `Reopen in Container` to reopen the most recent devcontainer build\n\n## Versioning\n\nVersioning generally follows [Semantic Versioning](https://semver.org/).\n\n## Making a release\n\nReleases to PyPI and GitHub are triggered by pushing a tag.\n\n1. Ensure all changes for the release are present in the `main` branch\n1. Tag with the new version: `git tag vX.Y.Z` for regular release, `git tag vX.Y.Z-preN` for pre-release\n1. Push the new version tag: `git push origin vX.Y.Z`\n\n## License\n\n[Apache 2.0](LICENSE)\n\nInspired by matthorgan's [`pre-commit-conventional-commits`](https://github.com/matthorgan/pre-commit-conventional-commits).\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompilerla%2Fconventional-pre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompilerla%2Fconventional-pre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompilerla%2Fconventional-pre-commit/lists"}