Class: Pronto::Standardrb

Inherits:
Runner
  • Object
show all
Defined in:
lib/pronto/standardrb.rb

Instance Method Summary collapse

Instance Method Details

#rubocop_config(patch) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/pronto/standardrb.rb', line 21

def rubocop_config(patch)
  builds_config = Standard::BuildsConfig.new
  config = builds_config.call([])

  @rubocop_config ||= begin
                        store = config.rubocop_config_store 
                        store.for(path(patch))
                      end
end

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pronto/standardrb.rb', line 8

def run
  ruby_patches
    .select { |patch| patch.additions > 0 }
    .flat_map do |patch|
    offenses(patch).flat_map do |offense|
      patch
        .added_lines
        .select { |line| line.new_lineno == offense.line }
        .map { |line| new_message(offense, line) }
    end
  end
end