{"id":16836628,"url":"https://github.com/shreyasminocha/seven-rule-msg","last_synced_at":"2025-03-23T15:31:36.911Z","repository":{"id":46745152,"uuid":"165541687","full_name":"shreyasminocha/seven-rule-msg","owner":"shreyasminocha","description":"✅ Minimal, opinionated commit message validator","archived":false,"fork":false,"pushed_at":"2021-09-27T22:46:21.000Z","size":390,"stargazers_count":11,"open_issues_count":9,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T21:54:30.255Z","etag":null,"topics":["commit","commit-conventions","commit-message","commit-msg","commitlint"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shreyasminocha.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-13T18:49:27.000Z","updated_at":"2024-12-17T18:55:49.000Z","dependencies_parsed_at":"2022-09-26T18:01:46.886Z","dependency_job_id":null,"html_url":"https://github.com/shreyasminocha/seven-rule-msg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasminocha%2Fseven-rule-msg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasminocha%2Fseven-rule-msg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasminocha%2Fseven-rule-msg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasminocha%2Fseven-rule-msg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shreyasminocha","download_url":"https://codeload.github.com/shreyasminocha/seven-rule-msg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122859,"owners_count":20564396,"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","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":["commit","commit-conventions","commit-message","commit-msg","commitlint"],"created_at":"2024-10-13T12:14:07.161Z","updated_at":"2025-03-23T15:31:36.309Z","avatar_url":"https://github.com/shreyasminocha.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seven-rule-msg\n\n[![Build status](https://img.shields.io/travis/com/shreyasminocha/seven-rule-msg/master.svg)](//travis-ci.org/shreyasminocha/seven-rule-msg)\n[![Npm version](https://img.shields.io/npm/v/seven-rule-msg.svg)](//npmjs.com/package/seven-rule-msg)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](//shreyas.mit-license.org/2019)\n[![Commit message style](https://img.shields.io/badge/commit%20messages-seven%20rules-blue.svg)](//chris.beams.io/posts/git-commit)\n\n![seven-rule-msg in action](https://raw.githubusercontent.com/shreyasminocha/seven-rule-msg/master/media/demo.jpg)\n\nMinimal, opinionated commit message validator.\n\n## Rules\n\nAll rules are inspired from [Chris' post and its predecessors](https://chris.beams.io/posts/git-commit).\n\n1. [Separate subject from body with a blank line](https://chris.beams.io/posts/git-commit/#separate)\n2. [Limit the subject line to 50 characters](https://chris.beams.io/posts/git-commit/#limit-50)\n3. [Capitalize the subject line](https://chris.beams.io/posts/git-commit/#capitalize)\n4. [Do not end the subject line with a period](https://chris.beams.io/posts/git-commit/#end)\n5. [Use the imperative mood in the subject line](https://chris.beams.io/posts/git-commit/#imperative) (not checked)\n6. [Wrap the body at 72 characters](https://chris.beams.io/posts/git-commit/#wrap-72)\n7. [Use the body to explain what and why vs. how](https://chris.beams.io/posts/git-commit/#why-not-how) (not checked)\n\n## Features\n\n- No configuration required\n- Beautiful output\n- Read from `$1`\n- Read from file\n- Read from `STDIN`\n- Verbose mode\n- Silent mode\n\n## Comparison with other tools\n\n| Feature | [**`seven-rule-msg`**](//github.com/shreyasminocha/seven-rule-msg) | [`commitlint`](//github.com/conventional-changelog/commitlint) | [`node-commit-msg`](//github.com/clns/node-commit-msg) |\n|---------|:---:|:---:|:---:|\n| Ability to test for seven rules | ✅| ✅| ✅|\n| Designed to test for seven rules | ✅| ❌ | ✅|\n| Opinionated | ✅| ❌ | ❌ |\n| Beautiful output | ✅| ✅| ❌ |\n| Easy installation | ✅| ✅| ❌ |\n| Zero setup | ✅| ✅| ❌ |\n| Does one thing (and does it well) | ✅| ❌ | ❌ |\n| Checks for imperative tense | ❌ \u003csup\u003e1\u003c/sup\u003e | ⚠️ \u003csup\u003e2\u003c/sup\u003e | ⚠️ \u003csup\u003e3\u003c/sup\u003e |\n\n\u003csup\u003e1\u003c/sup\u003e Programmatically checking for imperative tense is non-trivial and error-prone\n\n\u003csup\u003e2\u003c/sup\u003e Deprecated\n\n\u003csup\u003e3\u003c/sup\u003e Requires separate installation of Java 8\n\n## Installation\n\nAssuming you have [`npm`](//npmjs.com) installed,\n\n```sh\nnpm install --global seven-rule-msg-cli\n```\n\n## Usage\n\n### From CLI\n\nSee also: [`usage.txt`](usage.txt).\n\n#### CLI Argument\n\n```sh\nseven-rule-msg 'Fix all the stuff'\n```\n\n#### File\n\n```sh\nseven-rule-msg [--file|-f] \u003cpath-to-file\u003e\n```\n\n#### `STDIN`\n\n```sh\necho 'Fix all the stuff' | seven-rule-msg\n```\n\n### As git hook\n\n`.git/hooks/commit-msg`:\n\n```sh\n!/bin/sh\n\nseven-rule-msg -f \"$1\"\n```\n\n### Using the node.js API\n\n```js\nimport validate from 'seven-rule-msg';\n\nconst results = validate('A nice lil commit message');\n```\n\n#### `validate(commitMessage: string)`\n\n- Return value: `Result[]`\n    - Length: `7`\n\nThe `i`th element of the returned array corresponds to the `i + 1`th rule.\n\n```ts\ninterface Result {\n    readonly rule: Rule,\n    readonly type: ResultType\n}\n```\n\n```ts\ninterface Rule {\n    readonly message: string,\n    readonly test?: (commitMessage: string) =\u003e boolean;\n}\n```\n\n`Rule`s without `test` methods are informative only. In other words, they cannot be reliably checked programmatically.\n\n```ts\nenum ResultType {\n    pass = 'pass',\n    fail = 'fail',\n    info = 'info'\n}\n```\n\n## Badge\n\nHere's a badge to show the world that you follow the seven rules of commit messages.\n\n```md\n[![Commit message style](https://img.shields.io/badge/commit%20messages-seven%20rules-blue.svg)](https://chris.beams.io/posts/git-commit)\n```\n\n## License\n\nLicensed under the [MIT License](//shreyas.mit-license.org/2019).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyasminocha%2Fseven-rule-msg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshreyasminocha%2Fseven-rule-msg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyasminocha%2Fseven-rule-msg/lists"}