Sha256: 899b8edde0e4a8c6bd392d5758d8f82445765e49fe7dadd5716bd7fd33c50e94
Contents?: true
Size: 507 Bytes
Versions: 21
Compression:
Stored size: 507 Bytes
Contents
module Overcommit::Hook::PreCommit # Checks the format of an author's email address. class AuthorEmail < Base def run result = execute(%w[git config --get user.email]) email = result.stdout.chomp unless email =~ /#{config['pattern']}/ return :fail, "Author has an invalid email address: '#{email}'\n" \ 'Set your email with ' \ '`git config --global user.email your_email@example.com`' end :pass end end end
Version data entries
21 entries across 21 versions & 2 rubygems