Socket
Socket
Sign inDemoInstall

commit-verify

Package Overview
Dependencies
40
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    commit-verify

Auto commit message format verify hook


Version published
Weekly downloads
1
decreased by-93.75%
Maintainers
1
Install size
2.81 MB
Created
Weekly downloads
 

Readme

Source

commit-verify

Auto commit message format verify hook

Usage

  pnpm add -D commit-verify

Add verify command cv to husky hook file .husky/commit-msg :

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install cv $1

Config

example:

// `cv.config.js` or `.cvrc.json` ...
const { defineConfig } = require('commit-verify')

module.exports = defineConfig({
  // auto add emoji to commit message
  emoji: true,
})

Available configuration

emoji
  • default: false

whether auto add emoji to commit msg

  // pos: start
  feat(scope): msg -> feat(scope)🍉: msg
  // pos: end
  feat(scope): msg -> feat(scope): msg 🍉
emojiList
  • default: ['🍓', '🍉', '🍇', '🍒', '🍡', '🍥', '🍩', '🍰', '🍭', '🌸', '🌈']

will add random emoji list

emojiPos
  • default: start

  • enum: start | end

will add emoji position in commit msg

format
  • default: /^(((feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps?|merge|examples?|revert)(\(.+\))?:)|(Merge|Revert|Version)) .{1,50}$/i

  • type: RegExp | false

allow commit msg format.

default support:

  1. github Merge / Revert

  2. common commit type

  3. changesets Version Packages

transformer
  • default: (v) => v

custom commit msg transoform on format regex check after

Command line

Following options are supported for command line use:

  • emoji

  • emojiPos

example:

  npx --no-install cv $1 --emoji --emoji-pos=end

License

MIT

Keywords

FAQs

Last updated on 23 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc