Sha256: 2dd776220f167c672394658594124c4f478543297e09213c43ac0a44e9c9e510

Contents?: true

Size: 487 Bytes

Versions: 12

Compression:

Stored size: 487 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不符合规范!'.red
  exit 1
end

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

commit_check

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ggsm-1.9.3 lib/ggsm/hook/commit-msg
ggsm-1.9.2 lib/ggsm/hook/commit-msg
ggsm-1.9.1 lib/ggsm/hook/commit-msg
ggsm-1.9.0 lib/ggsm/hook/commit-msg
ggsm-1.8.6 lib/ggsm/hook/commit-msg
ggsm-1.8.5 lib/ggsm/hook/commit-msg
ggsm-1.8.4 lib/ggsm/hook/commit-msg
ggsm-1.8.3 lib/ggsm/hook/commit-msg
ggsm-1.8.2 lib/ggsm/hook/commit-msg
ggsm-1.8.1 lib/ggsm/hook/commit-msg
ggsm-1.8.0 lib/ggsm/hook/commit-msg
ggsm-1.7.6 lib/ggsm/hook/commit-msg