Class: RuboCop::Yardoc::Plugin

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

Overview

A plugin that integrates RuboCop Yardoc with RuboCop's plugin system.

Instance Method Summary collapse

Instance Method Details

#aboutObject

Information about the plugin



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

def about
  LintRoller::About.new(
    name:        'rubocop-yardoc',
    version:     RuboCop::Yardoc::VERSION,
    homepage:    '__FIXME__',
    description: 'A collection of RuboCop cops to check for Yardoc documentation.'
  )
end

#rules(_context) ⇒ Object

Rules configuration

Parameters:

  • _context (LintRoller::Context)

    Execution context



30
31
32
33
34
35
36
# File 'lib/rubocop/yardoc/plugin.rb', line 30

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

  ConfigObsoletion.files << project_root.join('config', 'obsoletion.yml')

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

#supported?(context) ⇒ Boolean

Whether the plugin can run in given context

Parameters:

  • context (LintRoller::Context)

    Execution context

Returns:

  • (Boolean)


23
24
25
# File 'lib/rubocop/yardoc/plugin.rb', line 23

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