Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fatso83/check-commit-msg

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fatso83/check-commit-msg

Check if your commit message follows Chris Beam's "Seven rules of a good commit message"

  • 2.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@fatso83/check-commit-msg

Simple util to check that commits follow a certain template

The 7 rules of a good commit message

1. Separate subject from body with a blank line
2. Limit the subject line to 50 characters
3. Capitalize the subject line
4. Do not end the subject line with a period
5. Use the imperative mood in the subject line
6. Wrap the body at 72 characters
7. Use the body to explain what and why vs. how

Source: Chris Beams

Currently it also checks if your commit starts with a JIRA identifier (FOO-123) as well, but this is easy to fix/remove.

General Usage

npm install -g @fatso83/check-commit-msg
echo << 'EOF' > .git/hooks/commit-msg 
check-commit-msg $1
EOF
chmod +x .git/hooks/commit-msg  #make it executable

Using with Husky

If you use husky in your NPM commit hooks

 npm install -D @fatso83/check-commit-msg

Then add this to your package.json scripts' section:

    "commitmsg": "node -r '@fatso83/check-commit-msg/husky'"

Improvements welcome

Need something? Suggestions? Pull requests welcome :)

Keywords

FAQs

Package last updated on 24 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc