Class: RuboCop::Migration::Plugin

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

Instance Method Summary collapse

Instance Method Details

#aboutObject



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

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

#rules(_context) ⇒ Object



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

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

#supported?(context) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rubocop/migration/plugin.rb', line 25

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