Sha256: 2b54308812adb36ec2d327265cc82fb82eb3cb0978d4c764bfab7d0081d04964
Contents?: true
Size: 511 Bytes
Versions: 11
Compression:
Stored size: 511 Bytes
Contents
module Overcommit::Hook::PreCommit # Ensures that a commit author has a name with at least first and last names. class AuthorName < Base def run result = execute(%w[git config --get user.name]) name = result.stdout.chomp unless name.split(' ').count >= 2 return :fail, "Author must have at least first and last name, but was: #{name}." \ "\nSet your name with `git config --global user.name 'Your Name'`" end :pass end end end
Version data entries
11 entries across 11 versions & 2 rubygems