Sha256: 5823692e3c9ab9e12dd1a8100706767d62c789918b65d898622e12d81c45087d

Contents?: true

Size: 446 Bytes

Versions: 18

Compression:

Stored size: 446 Bytes

Contents

module Overcommit::GitHook
  class TextWidth < HookSpecificCheck
    include HookRegistry

    def run_check
      if commit_message.first.size > 60
        return :warn, 'Please keep the subject < ~60 characters'
      end

      commit_message.each do |line|
        chomped = line.chomp
        if chomped.size > 72
          return :warn, "> 72 characters, please hard wrap: '#{chomped}'"
        end
      end

      :good
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
overcommit-0.5.0 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.4.1 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.4.0 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.3.2 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.3.1 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.3.0 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.6 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.5 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.4 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.3 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.2 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.1 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.2.0 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.1.11 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.1.10 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.1.9 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.1.8 lib/overcommit/plugins/commit_msg/text_width.rb
overcommit-0.1.7 lib/overcommit/plugins/commit_msg/text_width.rb