Sha256: 4ca98c09356559508799d790ad7a6897c6bbcbc51a045d36faf40c473b6a8640

Contents?: true

Size: 779 Bytes

Versions: 8

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module CLI
      module Actions
        # Handles unsaved Git commit action.
        class Hook
          def initialize analyzer: Analyzer.new, container: Container
            @analyzer = analyzer
            @container = container
          end

          def call path
            analyzer.call commits: [repository.unsaved(path)] do |collector, reporter|
              kernel.puts reporter
              kernel.abort if collector.errors?
            end
          end

          private

          attr_reader :analyzer, :container

          def repository = container[__method__]

          def kernel = container[__method__]

          def logger = container[__method__]
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
git-lint-3.3.2 lib/git/lint/cli/actions/hook.rb
git-lint-3.3.1 lib/git/lint/cli/actions/hook.rb
git-lint-3.3.0 lib/git/lint/cli/actions/hook.rb
git-lint-3.2.0 lib/git/lint/cli/actions/hook.rb
git-lint-3.1.0 lib/git/lint/cli/actions/hook.rb
git-lint-3.0.2 lib/git/lint/cli/actions/hook.rb
git-lint-3.0.1 lib/git/lint/cli/actions/hook.rb
git-lint-3.0.0 lib/git/lint/cli/actions/hook.rb