{"id":16692630,"url":"https://github.com/platisd/bad-commit-message-blocker","last_synced_at":"2025-09-13T08:37:43.834Z","repository":{"id":45326359,"uuid":"184318834","full_name":"platisd/bad-commit-message-blocker","owner":"platisd","description":"Inhibits commits with bad messages from getting merged","archived":false,"fork":false,"pushed_at":"2024-08-15T20:59:49.000Z","size":23,"stargazers_count":62,"open_issues_count":4,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-16T10:30:47.874Z","etag":null,"topics":["best-practices","code-review","commit-message","continuous-integration","git","nlp","nltk","textblob","travis-ci"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/platisd.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}},"created_at":"2019-04-30T19:21:01.000Z","updated_at":"2024-08-15T20:56:01.000Z","dependencies_parsed_at":"2025-06-09T05:42:12.214Z","dependency_job_id":null,"html_url":"https://github.com/platisd/bad-commit-message-blocker","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.03448275862068961,"last_synced_commit":"009806d8ce1fe1e32138a8453bc1f6d73b746d83"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/platisd/bad-commit-message-blocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platisd%2Fbad-commit-message-blocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platisd%2Fbad-commit-message-blocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platisd%2Fbad-commit-message-blocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platisd%2Fbad-commit-message-blocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/platisd","download_url":"https://codeload.github.com/platisd/bad-commit-message-blocker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platisd%2Fbad-commit-message-blocker/sbom","scorecard":{"id":737321,"data":{"date":"2025-08-11","repo":{"name":"github.com/platisd/bad-commit-message-blocker","commit":"d01cb04300f1e327c3f19b61a9b419b19f684ede"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/commit-messages.yml:1","Warn: no topLevel permission defined: .github/workflows/test-action.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/commit-messages.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/platisd/bad-commit-message-blocker/commit-messages.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-action.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/platisd/bad-commit-message-blocker/test-action.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-action.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/platisd/bad-commit-message-blocker/test-action.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.7-slim-buster to python:3.7-slim-buster@sha256:9bd2bfc822a533f99cbe6b1311d5bf0ff136f776ebac9b985407829f17278935","Warn: pipCommand not pinned by hash: Dockerfile:6","Warn: pipCommand not pinned by hash: .github/workflows/test-action.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/test-action.yml:18","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T16:15:08.272Z","repository_id":45326359,"created_at":"2025-08-22T16:15:08.272Z","updated_at":"2025-08-22T16:15:08.272Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274940027,"owners_count":25377941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["best-practices","code-review","commit-message","continuous-integration","git","nlp","nltk","textblob","travis-ci"],"created_at":"2024-10-12T16:27:54.962Z","updated_at":"2025-09-13T08:37:43.814Z","avatar_url":"https://github.com/platisd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bad Commit Message Blocker [![Build Status](https://travis-ci.org/platisd/bad-commit-message-blocker.svg?branch=master)](https://travis-ci.org/platisd/bad-commit-message-blocker)\nA simple script, doing some natural language processing, to inhibit\n*git commits* with *bad messages* from getting merged.\n\n![screenshot](https://i.imgur.com/B52Qxo7.png)\n\n## What?\nA Python3 script, easy to integrate with various CI machinery\n(e.g. see [GitHub Actions example](#github-action))\nthat is meant to keep bad commit messages out of a project. It verifies\nwhether the [seven rules of a great Git commit message](https://chris.beams.io/posts/git-commit/)\nby Chris Beams, are being followed:\n\n1. Separate subject from body with a blank line\n2. Limit the subject line to 50 characters\n3. Capitalize the subject line\n4. Do not end the subject line with a period\n5. Use the imperative mood in the subject line\n6. Wrap the body at 72 characters\n7. Use the body to explain what and why vs. how\n\n## Why?\nThe more a project grows in contributors and size, the more important\nthe quality of its commit messages becomes.\n\nIt is ultimately hard to quantify what makes a *good* commit message.\nHowever, we can easily determine automatically whether it adheres to\nmost of the git commit message best practices. Having a script to\nautomatically verify that, aside of other rules that you might already\nenforce (e.g. checking whether a task or a requirement is referenced)\ncan save a lot of time in the long run as well as even avoid conflicts\nbetween the reviewer(s) and the reviewee.\n\nAfter adopting this script, what you get is a set of best practices,\nagreed upon by the project and automatically applied. This way,\neveryone has to follow them or CI will not allow that commit in.\nSimple as that! :innocent:\n\n## How?\nMost of the rules are trivial to implement in code, except two of them,\n*no. 5* and *no. 7*. Specifically, checking whether the commit subject\nbegins with *imperative* mood is tricky due to limitations of the Natural\nLanguage Processing libraries being utilized. You can read more about the\nconstraints [here](https://stackoverflow.com/a/9572724/6485320).\nEssentially, it boils down to the lack of many imperative sentences\nexisting in the datasets used when training the relevant statistical\nmodels. Subsequently, **the enforcement of this rule might produce some**\n**false positive and false negative errors**.\n\nOn the other hand, verifying whether the commit body actually explains\n*what* and *why* instead of *how* is not (?) possible, due to the\nsubjective nature of the problem.\nAll in all, in most cases, this is all the reviewers would have to do\nthemselves *manually*, to ensure the quality of a commit message.\n\n### Get started\nYou need to have Python3 installed and follow the steps bellow:\n* Install [TextBlob](https://textblob.readthedocs.io/en/dev/)\n  * `pip3 install --user textblob`\n* Install NLTK corpora\n  * `python3 -m textblob.download_corpora`\n* Run the script to verify a commit message\n  * `python3 bad_commit_message_blocker.py --message \"Add a really cool feature\"`\n* To define your own maximum character limits, call the script with the\nappropriate arguments:\n  * `--subject-limit` (defaults to `50`) to set the subject line limit. E.g.:\n    * `python3 bad_commit_message_blocker.py --subject-limit 80 --message \"Add a really cool feature\"`\n  * `--body-limit` (defaults to `72`) to set the body line limit. E.g.:\n    *  `python3 bad_commit_message_blocker.py --body-limit 120 --message \"Add a really cool feature\"`\n\n## GitHub Action\n\nNow you can use this script as part of your **GitHub Actions** CI pipeline.\n\nAn example configuration can be seen below:\n\n```yaml\nname: Commit messages\n\non: [pull_request]\n\njobs:\n  check-commit-message:\n    if: github.event.pull_request.user.type != 'Bot'  # a number of GitHub Apps that can send PRs don't have configurable commits\n    runs-on: ubuntu-20.04\n    steps:\n      - name: Verify commit messages follow best practices in CI\n        uses: platisd/bad-commit-message-blocker@master\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          # Optionally set the subject character limit (default `50`)\n          subject_limit: 60\n          # Optionally set the body character limit (default `72`)\n          body_limit: 100\n          # Optionally set the remote branch name to merge (default `master`)\n          remote_branch: dev\n          # Optionally allow \"conventional commits\" (default `false`)\n          allow_conventional_commits: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatisd%2Fbad-commit-message-blocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatisd%2Fbad-commit-message-blocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatisd%2Fbad-commit-message-blocker/lists"}