Class: Rubocop::Changes::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/changes/checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(format:, quiet:, commit:, auto_correct:, base_branch:) ⇒ Checker

Returns a new instance of Checker.



17
18
19
20
21
22
23
# File 'lib/rubocop/changes/checker.rb', line 17

def initialize(format:, quiet:, commit:, auto_correct:, base_branch:)
  @format = format
  @quiet = quiet
  @commit = commit
  @auto_correct = auto_correct
  @base_branch = base_branch
end

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
33
# File 'lib/rubocop/changes/checker.rb', line 25

def run
  raise UnknownBaseBranchError if base_branch.empty?
  raise UnknownForkPointError if fork_point.empty?
  raise UnknownFormat if formatter_klass.nil?

  print_offenses! unless quiet

  checks.map(&:offenses).flatten
end