lib/git/lint/cli/actions/analyze/commit.rb in git-lint-4.6.0 vs lib/git/lint/cli/actions/analyze/commit.rb in git-lint-5.0.0
- old
+ new
@@ -3,34 +3,31 @@
module Git
module Lint
module CLI
module Actions
module Analyze
- # Handles analyze action for commit(s) by SHA.
+ # Handles analyze action for single commit SHA
class Commit
- include Git::Lint::Import[:kernel, :logger]
+ include Git::Lint::Import[:git, :kernel, :logger]
- def initialize analyzer: Analyzer.new,
- parser: GitPlus::Parsers::Commits::Saved::History.with_show,
- **dependencies
+ def initialize analyzer: Analyzer.new, **dependencies
super(**dependencies)
@analyzer = analyzer
- @parser = parser
end
- def call sha = nil
- process sha
+ def call *arguments
+ process arguments.unshift "-1"
rescue Errors::Base => error
logger.error { error.message }
kernel.abort
end
private
- attr_reader :analyzer, :parser
+ attr_reader :analyzer
- def process sha
- analyzer.call commits: parser.call(*sha) do |collector, reporter|
+ def process arguments
+ analyzer.call commits: git.commits(*arguments) do |collector, reporter|
kernel.puts reporter
kernel.abort if collector.errors?
end
end
end