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, custom_config = nil) ⇒ StyleGuide

Returns a new instance of StyleGuide.



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

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

Instance Method Details

#inspectObject



19
20
21
# File 'lib/rubocop/git/style_guide.rb', line 19

def inspect
  "#<#{self.class.name}>"
end

#violations(file) ⇒ Object



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

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