Sha256: 18c7febca48f8bc575aa2c6e6bc3ff0384bded9d0285552d8898fe9a92e4f658
Contents?: true
Size: 751 Bytes
Versions: 11
Compression:
Stored size: 751 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers class CommitSubjectSuffix < Abstract def self.defaults { enabled: true, severity: :error, excludes: [ "\\.", "\\?", "\\!" ] } end 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.fetch(:excludes) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems