Class: RuboCop::Rubomatic::Plugin

Inherits:
LintRoller::Plugin
  • Object
show all
Defined in:
lib/rubocop/rubomatic/plugin.rb

Overview

A plugin that integrates RuboCop Performance with RuboCop’s plugin system.

Instance Method Summary collapse

Instance Method Details

#aboutObject

:nodoc:



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

def about
  LintRoller::About.new(
    name: 'rubocop-rubomatic',
    version: VERSION::STRING,
    homepage: 'https://github.com/BrandsInsurance/rubocop-rubomatic/',
    description: 'A collection of RuboCop cops to check for performance optimizations in Ruby code.'
  )
end

#rules(_context) ⇒ Object

:nodoc:



25
26
27
28
29
30
31
# File 'lib/rubocop/rubomatic/plugin.rb', line 25

def rules(_context)
  LintRoller::Rules.new(
    type: :path,
    config_format: :rubocop,
    value: Pathname.new(__dir__).join('../../../config/default.yml')
  )
end

#supported?(context) ⇒ Boolean

:nodoc:



20
21
22
# File 'lib/rubocop/rubomatic/plugin.rb', line 20

def supported?(context)
  context.engine == :rubocop
end