module Overcommit::Hook::PreCommit
  # Checks for hard tabs in files.
  class HardTabs < Base
    def run
      paths = applicable_files.join(' ')

      # Catches hard tabs
      result = command("grep -IHn \"\\t\" #{paths}")
      unless result.stdout.empty?
        return :bad, "Hard tabs detected:\n#{result.stdout}"
      end

      :good
    end
  end
end

module Overcommit::Hook::PreCommit
  # Checks for hard tabs in files.
  class HardTabs < Base
    def run
      paths = applicable_files.join(' ')

      # Catches hard tabs
      result = command("grep -IHn \"\t\" #{paths}")
      unless result.stdout.empty?
        return :bad, "Hard tabs detected:\n#{result.stdout}"
      end

      :good
    end
  end
end

Use tab character in HardTabs pre-commit hook
Use tab character in HardTabs pre-commit hook

Turns out some systems don't support `\t` as an escape sequence. This
was resulting one spec failing for this hook.

Changing it to a literal tab solves the problem.

Change-Id: If4d50b64d2d341cb673cd1bb7c54f8841729b21d
Reviewed-on: http://gerrit.causes.com/35626
Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
Tested-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
