Sha256: 98c724f08c2097bb39b124d93692f4b9fa6e44a8645bd0b8cf05975da5812830
Contents?: true
Size: 596 Bytes
Versions: 22
Compression:
Stored size: 596 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers # Analyzes pretense of commit body. class CommitBodyPresence < Abstract using ::Refinements::Strings def valid? return true if commit.fixup? valid_lines = commit.body_lines.grep_v(/^\s*$/) valid_lines.size >= minimum end def minimum = settings.minimum def issue return {} if valid? {hint: %(Use minimum of #{"#{minimum} line".pluralize "s", count: minimum} (non-empty).)} end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems