Sha256: 0fbc6866a9929a83846e82716b6f8e2b20d3ff93bb5c8b3f2df2762160a24c7a

Contents?: true

Size: 690 Bytes

Versions: 22

Compression:

Stored size: 690 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.includes)

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

        def pattern = Regexp.union(filter_list.to_regexp)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
git-lint-5.3.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-5.2.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-5.1.2 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-5.1.1 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-5.1.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-5.0.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.6.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.5.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.4.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.3.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.2.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.1.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.0.1 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-4.0.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-3.3.2 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-3.3.1 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-3.3.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-3.2.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-3.1.0 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
git-lint-3.0.2 lib/git/lint/analyzers/commit_body_bullet_delimiter.rb