Class: RuboCop::DisableSyntax::Plugin

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

Overview

A plugin that integrates RuboCop Disable Syntax with RuboCop’s plugin system.

Instance Method Summary collapse

Instance Method Details

#aboutObject



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

def about
  LintRoller::About.new(
    name: "rubocop-disable_syntax",
    version: VERSION,
    homepage: "https://github.com/fatkodima/rubocop-disable_syntax",
    description: "A RuboCop plugin that allows to disable some unfavorite ruby syntax, " \
                 "such as `unless`, safe navigation etc."
  )
end

#rules(_context) ⇒ Object



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

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)


19
20
21
# File 'lib/rubocop/disable_syntax/plugin.rb', line 19

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