class Git::Lint::Analyzers::CommitBodyBullet

Public Class Methods

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

Public Instance Methods

invalid_line?(line) click to toggle source

:reek: FeatureEnvy

# File lib/git/lint/analyzers/commit_body_bullet.rb, line 31
def invalid_line? line
  return false if line.strip.empty?

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

  {
    hint: %(Avoid: #{filter_list.to_hint}.),
    lines: affected_commit_body_lines
  }
end
load_filter_list(= Kit::FilterList.new(settings.fetch(:excludes))) click to toggle source
# File lib/git/lint/analyzers/commit_body_bullet.rb, line 28
  def load_filter_list = Kit::FilterList.new(settings.fetch(:excludes))

  # :reek:FeatureEnvy
  def invalid_line? line
    return false if line.strip.empty?

    !line.match?(/\A(?!\s*#{Regexp.union filter_list.to_regexp}\s+).+\Z/)
  end
end
valid?(= commit.body_lines.all? { |line| !invalid_line? line }) click to toggle source
# File lib/git/lint/analyzers/commit_body_bullet.rb, line 15
    def valid? = commit.body_lines.all? { |line| !invalid_line? line }

    def issue
      return {} if valid?

      {
        hint: %(Avoid: #{filter_list.to_hint}.),
        lines: affected_commit_body_lines
      }
    end

    protected

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

    # :reek:FeatureEnvy
    def invalid_line? line
      return false if line.strip.empty?

      !line.match?(/\A(?!\s*#{Regexp.union filter_list.to_regexp}\s+).+\Z/)
    end
  end
end