Sha256: eb65a4f75c12c157629ec95ba0cfd2244c940803b7462f611294e39029be44ac

Contents?: true

Size: 700 Bytes

Versions: 6

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit bodies with only a single bullet point.
      class CommitBodySingleBullet < Abstract
        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 configuration.commits_body_single_bullet_includes
        end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
git-lint-6.2.1 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-6.2.0 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-6.1.0 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-6.0.2 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-6.0.1 lib/git/lint/analyzers/commit_body_single_bullet.rb
git-lint-6.0.0 lib/git/lint/analyzers/commit_body_single_bullet.rb