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