Sha256: 2dcd9343b8c74825e7dd1e5d3517d08c0905f976f9da9d9d1d27d4231dd16fcf
Contents?: true
Size: 892 Bytes
Versions: 11
Compression:
Stored size: 892 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers class CommitBodyBullet < Abstract def self.defaults { enabled: true, severity: :error, excludes: %w[\\* •] } end def valid? commit.body_lines.all? { |line| !invalid_line? line } end def issue return {} if valid? { hint: %(Avoid: #{filter_list.to_hint}.), lines: affected_commit_body_lines } end protected def load_filter_list Kit::FilterList.new settings.fetch :excludes end # :reek:FeatureEnvy def invalid_line? line return false if line.strip.empty? !line.match?(/\A(?!\s*#{Regexp.union filter_list.to_regexp}\s+).+\Z/) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems