Class: RuboCop::Elegant::Plugin

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

Instance Method Summary collapse

Instance Method Details

#aboutObject



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

def about
  LintRoller::About.new(
    name: 'rubocop-elegant',
    version: VERSION,
    homepage: 'https://github.com/yegor256/rubocop-elegant',
    description: 'Set of custom RuboCop cops for elegant Ruby coding'
  )
end

#rules(_context) ⇒ Object



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

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

#supported?(context) ⇒ Boolean

Returns:

  • (Boolean)


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

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