lib/git/lint/analyzers/commit_body_presence.rb in git-lint-2.4.0 vs lib/git/lint/analyzers/commit_body_presence.rb in git-lint-3.0.0
- old
+ new
@@ -1,33 +1,26 @@
# frozen_string_literal: true
module Git
module Lint
module Analyzers
+ # Analyzes pretense of commit body.
class CommitBodyPresence < Abstract
- using GitPlus::Refinements::Strings
+ 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.grep_v(/^\s*$/)
valid_lines.size >= minimum
end
- def minimum = settings.fetch(:minimum)
+ def minimum = settings.minimum
def issue
return {} if valid?
- {hint: %(Use minimum of #{"line".pluralize count: minimum} (non-empty).)}
+ {hint: %(Use minimum of #{"#{minimum} line".pluralize "s", count: minimum} (non-empty).)}
end
end
end
end
end