Sha256: 31fa5173ff42d3ecabd546afcba489ee77ebb568a5f8f2ef56ee3c423057ff44

Contents?: true

Size: 728 Bytes

Versions: 9

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit body delimiter usage.
      class CommitBodyBulletDelimiter < Abstract
        def valid? = commit.body_lines.none? { |line| invalid_line? line }

        def issue
          return {} if valid?

          {
            hint: "Use space after bullet.",
            lines: affected_commit_body_lines
          }
        end

        protected

        def load_filter_list
          Kit::FilterList.new settings.commits_body_bullet_delimiter_includes
        end

        def invalid_line?(line) = line.match?(/\A\s*#{pattern}(?!(#{pattern}|\s)).+\Z/)

        def pattern = Regexp.union filter_list
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
git-lint-8.8.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.7.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.6.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.5.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.4.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.3.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.2.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.1.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-8.0.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb