Class: RuboCop::RSpecRails::Plugin

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#aboutObject

:nocov:



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

def about
  LintRoller::About.new(
    name: 'rubocop-rspec_rails',
    version: Version::STRING,
    homepage: 'https://github.com/rubocop/rubocop-rspec_rails',
    description: 'Code style checking for RSpec Rails files.'
  )
end

#rules(_context) ⇒ Object



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

def rules(_context)
  project_root = Pathname.new(__dir__).join('../../..')

  LintRoller::Rules.new(
    type: :path,
    config_format: :rubocop,
    value: project_root.join('config/default.yml')
  )
end

#supported?(context) ⇒ Boolean

:nocov:

Returns:

  • (Boolean)


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

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