Class: Pronto::Rubocop

Inherits:
Runner
  • Object
show all
Defined in:
lib/pronto/rubocop.rb,
lib/pronto/rubocop/patch_cop.rb,
lib/pronto/rubocop/offense_line.rb

Defined Under Namespace

Classes: OffenseLine, PatchCop

Instance Method Summary collapse

Instance Method Details

#pronto_rubocop_configObject



18
19
20
# File 'lib/pronto/rubocop.rb', line 18

def pronto_rubocop_config
  @pronto_rubocop_config ||= Pronto::ConfigFile.new.to_h['rubocop'] || {}
end

#runObject



10
11
12
13
14
15
16
# File 'lib/pronto/rubocop.rb', line 10

def run
  return [] unless @patches

  @patches
    .select { |patch| patch.additions.positive? }
    .flat_map { |patch| PatchCop.new(patch, self).messages }
end