class Git::Lint::Analyzers::CommitBodySingleBullet

Public Class Methods

defaults() click to toggle source
# File lib/git/lint/analyzers/commit_body_single_bullet.rb, line 7
def self.defaults
  {
    enabled: true,
    severity: :error,
    includes: %w[\\-]
  }
end

Public Instance Methods

invalid_line?(line) click to toggle source
# File lib/git/lint/analyzers/commit_body_single_bullet.rb, line 30
  def invalid_line?(line) = line.match?(/\A#{Regexp.union filter_list.to_regexp}\s+/)
end
issue() click to toggle source
# File lib/git/lint/analyzers/commit_body_single_bullet.rb, line 17
def issue
  return {} if valid?

  {
    hint: "Use paragraph instead of single bullet.",
    lines: affected_commit_body_lines
  }
end
load_filter_list(= Kit::FilterList.new(settings.fetch(:includes))) click to toggle source
# File lib/git/lint/analyzers/commit_body_single_bullet.rb, line 28
    def load_filter_list = Kit::FilterList.new(settings.fetch(:includes))

    def invalid_line?(line) = line.match?(/\A#{Regexp.union filter_list.to_regexp}\s+/)
  end
end
valid?(= affected_commit_body_lines.size != 1) click to toggle source
# File lib/git/lint/analyzers/commit_body_single_bullet.rb, line 15
      def valid? = affected_commit_body_lines.size != 1

      def issue
        return {} if valid?

        {
          hint: "Use paragraph instead of single bullet.",
          lines: affected_commit_body_lines
        }
      end

      protected

      def load_filter_list = Kit::FilterList.new(settings.fetch(:includes))

      def invalid_line?(line) = line.match?(/\A#{Regexp.union filter_list.to_regexp}\s+/)
    end
  end
end