lib/git/lint/analyzer.rb in git-lint-3.3.2 vs lib/git/lint/analyzer.rb in git-lint-4.0.0
- old
+ new
@@ -2,10 +2,12 @@
module Git
module Lint
# Runs all analyzers.
class Analyzer
+ include Import[:configuration]
+
ANALYZERS = [
Analyzers::CommitAuthorCapitalization,
Analyzers::CommitAuthorEmail,
Analyzers::CommitAuthorName,
Analyzers::CommitBodyBullet,
@@ -30,15 +32,15 @@
# rubocop:disable Metrics/ParameterLists
def initialize analyzers: ANALYZERS,
collector: Collector.new,
reporter: Reporters::Branch,
- container: Container
+ **dependencies
+ super(**dependencies)
@analyzers = analyzers
@collector = collector
@reporter = reporter
- @container = container
end
# rubocop:enable Metrics/ParameterLists
def call commits: Commits::Loader.new.call
process commits
@@ -46,11 +48,11 @@
block_given? ? yield(collector, a_reporter) : [collector, a_reporter]
end
private
- attr_reader :analyzers, :collector, :reporter, :container
+ attr_reader :analyzers, :collector, :reporter
def process commits
collector.clear
commits.map { |commit| analyze commit }
end
@@ -68,9 +70,9 @@
analyzer.new commit
end
end
- def settings = container[:configuration].analyzers
+ def settings = configuration.analyzers
end
end
end