Sha256: d5f2db213d2e72516f5f644bdd20d79884f7158ef6c6bd4b8432a8aa27fd141e

Contents?: true

Size: 571 Bytes

Versions: 3

Compression:

Stored size: 571 Bytes

Contents

#!/usr/bin/env ruby
require 'colorize'

@msg = IO.read(ARGV[0]).force_encoding('UTF-8')

def commit_check
  standards = %w(fix: fix: feat: feat: style: style: doc: doc: docs: docs: ref: ref: refactor: refactor: chore: chore: test: test: Merge merge Revert revert)
  standards.each do |standard|
    check(standard)
  end
  puts '==> commit message不符合规范,请查看规范:https://doc.souche-inc.com/pages/viewpage.action?pageId=6037872!'.red
  exit 1
end

def check(keyword)
  if @msg.start_with? keyword
    exit 0
  end
end

commit_check

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ggsm-1.9.6 lib/ggsm/hook/commit-msg
ggsm-1.9.5 lib/ggsm/hook/commit-msg
ggsm-1.9.4 lib/ggsm/hook/commit-msg