Sha256: 38b574d36f28a1830dfbb11906bfc9aa407e3b1f3ba03c2d47da1e5342467482

Contents?: true

Size: 496 Bytes

Versions: 11

Compression:

Stored size: 496 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 = configuration.commits_subject_length_maximum
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
git-lint-7.5.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-7.3.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-7.2.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-7.1.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-7.0.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-6.2.1 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-6.2.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-6.1.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-6.0.2 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-6.0.1 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-6.0.0 lib/git/lint/analyzers/commit_subject_length.rb