Sha256: a490a86890a57fa47ea4cd05321156370c898329952e36093ed001f723af278b
Contents?: true
Size: 728 Bytes
Versions: 11
Compression:
Stored size: 728 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers class CommitBodyPresence < Abstract using Refinements::Strings def self.defaults { enabled: true, severity: :warn, minimum: 1 } end def valid? return true if commit.fixup? valid_lines = commit.body_lines.reject { |line| line.match?(/^\s*$/) } valid_lines.size >= minimum end def minimum settings.fetch :minimum end def issue return {} if valid? {hint: %(Use minimum of #{"line".pluralize count: minimum} (non-empty).)} end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems