Sha256: bf94d70997a1ff7b40a6e9737241ba2f6319709a0be08d9f8819e00631012b1c

Contents?: true

Size: 607 Bytes

Versions: 6

Compression:

Stored size: 607 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit subject suffix for punctuation.
      class CommitSubjectSuffix < Abstract
        def valid?
          return true if filter_list.empty?

          !commit.subject.match?(/#{Regexp.union filter_list.to_regexp}\Z/)
        end

        def issue
          return {} if valid?

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

        protected

        def load_filter_list
          Kit::FilterList.new configuration.commits_subject_suffix_excludes
        end
      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_subject_suffix.rb
git-lint-6.2.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-6.1.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-6.0.2 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-6.0.1 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-6.0.0 lib/git/lint/analyzers/commit_subject_suffix.rb