Class: RuboCop::Git::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/git/runner.rb

Overview

Instance Method Summary collapse

Instance Method Details

#run(options) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rubocop/git/runner.rb', line 7

def run(options)
  options = Options.new(options) unless options.is_a?(Options)

  @options = options
  @files = DiffParser.parse(git_diff(options))
  rubo_comment = RuboComment.new(@files)

  #adds comments to files and reparses diff after changes are made
  rubo_comment.add_comments
  @files = DiffParser.parse(git_diff(options))

  display_violations($stdout)
  #removes comments after rubocop processing
  rubo_comment.remove_comments

  exit(1) if violations.any?
end