Class: Overcommit::GitHook::HardTabs

Inherits:
HookSpecificCheck show all
Includes:
HookRegistry
Defined in:
lib/overcommit/plugins/commit_msg/hard_tabs.rb

Instance Method Summary collapse

Methods included from HookRegistry

included

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_checkObject



5
6
7
8
9
10
11
12
# File 'lib/overcommit/plugins/commit_msg/hard_tabs.rb', line 5

def run_check
  # Catches hard tabs entered by the user (not auto-generated)
  if commit_message.join.index /\t/
    return :warn, "Don't use hard tabs in commit messages"
  end

  :good
end