Class: RuboCop::Slim::Plugin

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

Instance Method Summary collapse

Instance Method Details

#aboutObject



8
9
10
11
12
13
14
15
# File 'lib/rubocop/slim/plugin.rb', line 8

def about
  ::LintRoller::About.new(
    description: 'RuboCop plugin for Slim template.',
    homepage: 'https://github.com/r7kamura/rubocop-slim',
    name: 'rubocop-slim',
    version: VERSION
  )
end

#rules(_context) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/rubocop/slim/plugin.rb', line 17

def rules(_context)
  ::RuboCop::Runner.ruby_extractors.unshift(::RuboCop::Slim::RubyExtractor)

  ::LintRoller::Rules.new(
    config_format: :rubocop,
    type: :path,
    value: "#{__dir__}/../../../config/default.yml"
  )
end

#supported?(context) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/rubocop/slim/plugin.rb', line 27

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