Class: Overcommit::GitHook::AuthorName
- Inherits:
-
HookSpecificCheck
- Object
- HookSpecificCheck
- Overcommit::GitHook::AuthorName
- Includes:
- HookRegistry
- Defined in:
- lib/overcommit/plugins/pre_commit/author_name.rb
Instance Method Summary collapse
Methods included from HookRegistry
Methods inherited from HookSpecificCheck
file_type, friendly_name, #initialize, #name, required!, #skip?, skippable?, #staged, stealth!, #stealth?
Constructor Details
This class inherits a constructor from Overcommit::GitHook::HookSpecificCheck
Instance Method Details
#run_check ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/overcommit/plugins/pre_commit/author_name.rb', line 5 def run_check name = `git config --get user.name`.chomp unless name.split(' ').count >= 2 return :bad, "Author must have at least first and last name; " << "was: '#{name}'.\n Set your name with " << "`git config --global user.name 'Your Name'`" end :good end |