Class: RuboCop::Git::StyleGuide

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

Overview

Instance Method Summary collapse

Constructor Details

#initialize(rubocop_options, config_file, override_config_content = nil) ⇒ StyleGuide

Returns a new instance of StyleGuide.



4
5
6
7
8
# File 'lib/rubocop/git/style_guide.rb', line 4

def initialize(rubocop_options, config_file, override_config_content = nil)
  @rubocop_options = rubocop_options
  @config_file = config_file
  @override_config_content = override_config_content
end

Instance Method Details

#violations(file) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/rubocop/git/style_guide.rb', line 10

def violations(file)
  if ignored_file?(file)
    []
  else
    parsed_source = parse_source(file)
    team = RuboCop::Cop::Team.new(all_cops, config, rubocop_options)
    team.inspect_file(parsed_source)
  end
end