Sha256: c37bf2e88a4b8da419ed21da79b45b95fbdd9b374f0620df2aa15ae5c78c9070
Contents?: true
Size: 746 Bytes
Versions: 2
Compression:
Stored size: 746 Bytes
Contents
# frozen_string_literal: true module Git module Lint module CLI module Actions # Handles unsaved Git commit action. class Hook include Git::Lint::Import[:git, :kernel, :logger] def initialize analyzer: Analyzer.new, **dependencies super(**dependencies) @analyzer = analyzer end def call path analyzer.call commits: commits(path) do |collector, reporter| kernel.puts reporter kernel.abort if collector.errors? end end private attr_reader :analyzer def commits(path) = git.uncommitted(path).fmap { |commit| [commit] } end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
git-lint-5.1.0 | lib/git/lint/cli/actions/hook.rb |
git-lint-5.0.0 | lib/git/lint/cli/actions/hook.rb |