Sha256: a9e44a77adc429cbc67887c19ed0001ee6cdafcd00aab543ccb4ff1ac0b39937

Contents?: true

Size: 743 Bytes

Versions: 5

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      class CommitBodySingleBullet < Abstract
        def self.defaults
          {
            enabled: true,
            severity: :error,
            includes: %w[\\-]
          }
        end

        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
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
git-lint-2.4.0 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-2.3.3 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-2.3.2 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-2.3.1 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-2.3.0 lib/git/lint/analyzers/commit_body_single_bullet.rb