Sha256: d04167e413b7c12832b8ff8e94a63049469355e3db3b5f530acc0e4acd3212c0

Contents?: true

Size: 396 Bytes

Versions: 28

Compression:

Stored size: 396 Bytes

Contents

# frozen_string_literal: true

module Overcommit::Hook::CommitMsg
  # Ensures commit message subject lines are followed by a blank line.
  class SingleLineSubject < Base
    def run
      return :pass if empty_message?

      unless commit_message_lines[1].to_s.strip.empty?
        return :warn, 'Subject should be one line and followed by a blank line'
      end

      :pass
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
overcommit-0.52.0 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.51.0 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.50.0 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.49.1 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.49.0 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.48.1 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.48.0 lib/overcommit/hook/commit_msg/single_line_subject.rb
overcommit-0.47.0 lib/overcommit/hook/commit_msg/single_line_subject.rb