Sha256: c0a87b5c58b8f7a2f7041e15026ce4aee8e6cd340f27b237d6af0c9b8c3a088a

Contents?: true

Size: 468 Bytes

Versions: 22

Compression:

Stored size: 468 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.maximum
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
git-lint-5.3.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-5.2.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-5.1.2 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-5.1.1 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-5.1.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-5.0.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.6.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.5.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.4.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.3.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.2.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.1.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.0.1 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-4.0.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-3.3.2 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-3.3.1 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-3.3.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-3.2.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-3.1.0 lib/git/lint/analyzers/commit_subject_length.rb
git-lint-3.0.2 lib/git/lint/analyzers/commit_subject_length.rb