Class: Overcommit::GitHook::TextWidth
- Inherits:
-
HookSpecificCheck
- Object
- HookSpecificCheck
- Overcommit::GitHook::TextWidth
- Includes:
- HookRegistry
- Defined in:
- lib/overcommit/plugins/commit_msg/text_width.rb
Instance Method Summary collapse
Methods included from HookRegistry
Methods inherited from HookSpecificCheck
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 15 16 17 18 |
# File 'lib/overcommit/plugins/commit_msg/text_width.rb', line 5 def run_check if .first.size > 60 return :warn, 'Please keep the subject < ~60 characters' end .each do |line| chomped = line.chomp if chomped.size > 72 return :warn, "> 72 characters, please hard wrap: '#{chomped}'" end end :good end |