Sha256: e418f78f46b783244fb79b572ef6228a2cf6ca72b96021015e26951807e2990c

Contents?: true

Size: 491 Bytes

Versions: 10

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit subject length is short and concise.
      class CommitSubjectLength < Abstract
        def valid? = commit.subject.sub(/(fixup!|squash!)\s{1}/, "").size <= maximum

        def issue
          return {} if valid?

          {hint: "Use #{maximum} characters or less."}
        end

        private

        def maximum = settings.commits_subject_length_maximum
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
git-lint-9.0.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.8.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.7.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.6.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.5.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.4.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.3.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.2.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.1.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-8.0.0 lib/git/lint/analyzers/commit_subject_length.rb