Sha256: 76bd30e55f154a94b42009e53957994d760527e4bcb8c4a515dc5a6f37c34ec7

Contents?: true

Size: 560 Bytes

Versions: 22

Compression:

Stored size: 560 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(settings.excludes)
      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_subject_suffix.rb
git-lint-5.2.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-5.1.2 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-5.1.1 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-5.1.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-5.0.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.6.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.5.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.4.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.3.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.2.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.1.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.0.1 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-4.0.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-3.3.2 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-3.3.1 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-3.3.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-3.2.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-3.1.0 lib/git/lint/analyzers/commit_subject_suffix.rb
git-lint-3.0.2 lib/git/lint/analyzers/commit_subject_suffix.rb