class Overcommit::Hook::CommitMsg::HardTabs

Checks for hard tabs in commit messages.

Public Instance Methods

run() click to toggle source
# File lib/overcommit/hook/commit_msg/hard_tabs.rb, line 6
def run
  return :pass if empty_message?

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

  :pass
end