Sha256: 81b48659f48733596306b1045bbb65ecd81a277155651e35cb57203a0507d8cd

Contents?: true

Size: 334 Bytes

Versions: 8

Compression:

Stored size: 334 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Checks for trailing whitespace in files.
  class TrailingWhitespace < Base
    def run
      result = execute(%w[grep -IHn \s$] + applicable_files)
      unless result.stdout.empty?
        return :fail, "Trailing whitespace detected:\n#{result.stdout}"
      end

      :pass
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
jawshooah-overcommit-0.22.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.21.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.20.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.19.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.18.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.17.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.16.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb
overcommit-0.15.0 lib/overcommit/hook/pre_commit/trailing_whitespace.rb