Class: RuboCop::HashInspect::Plugin

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

Overview

A plugin that integrates rubocop-hash_inspect with RuboCop’s plugin system.

Instance Method Summary collapse

Instance Method Details

#aboutObject



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

def about
  LintRoller::About.new(
    name: 'rubocop-hash_inspect',
    version: VERSION,
    homepage: 'https://github.com/puppetlabs/rubocop-hash_inspect',
    description: 'A RuboCop extension that flags reliance on legacy Hash#inspect output format.'
  )
end

#rules(_context) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/rubocop/hash_inspect/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/hash_inspect/plugin.rb', line 19

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