Sha256: ee3442fab0bc2f4ba7485ce65daae99af045139a2a62be26f5070de7762d9f2b
Contents?: true
Size: 699 Bytes
Versions: 14
Compression:
Stored size: 699 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers # Analyzes commit body for repeated words. class CommitBodyWordRepeat < Abstract include Import[validator: "validators.repeated_word"] def valid? = commit.body_lines.all? { |line| !invalid_line? line } def issue return {} if valid? { hint: "Avoid repeating these words: #{validator.call commit.body}.", lines: affected_commit_body_lines } end protected def invalid_line? line return false if line.start_with? "#" !validator.call(line).empty? end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems