class Git::Lint::Analyzers::CommitBodyLineLength

Public Class Methods

defaults() click to toggle source
# File lib/git/lint/analyzers/commit_body_line_length.rb, line 7
def self.defaults
  {
    enabled: true,
    severity: :error,
    length: 72
  }
end

Public Instance Methods

invalid_line?(line) click to toggle source
# File lib/git/lint/analyzers/commit_body_line_length.rb, line 28
    def invalid_line?(line) = line.length > length

    private

    def length = settings.fetch(:length)
  end
end
issue() click to toggle source
# File lib/git/lint/analyzers/commit_body_line_length.rb, line 17
def issue
  return {} if valid?

  {
    hint: "Use #{length} characters or less per line.",
    lines: affected_commit_body_lines
  }
end
length(= settings.fetch(:length)) click to toggle source
# File lib/git/lint/analyzers/commit_body_line_length.rb, line 32
  def length = settings.fetch(:length)
end
valid?(= commit.body_lines.all? { |line| !invalid_line? line }) click to toggle source
# File lib/git/lint/analyzers/commit_body_line_length.rb, line 15
      def valid? = commit.body_lines.all? { |line| !invalid_line? line }

      def issue
        return {} if valid?

        {
          hint: "Use #{length} characters or less per line.",
          lines: affected_commit_body_lines
        }
      end

      protected

      def invalid_line?(line) = line.length > length

      private

      def length = settings.fetch(:length)
    end
  end
end