Class: RuboCop::Capybara::Plugin
- Inherits:
-
LintRoller::Plugin
- Object
- LintRoller::Plugin
- RuboCop::Capybara::Plugin
- Defined in:
- lib/rubocop/capybara/plugin.rb
Overview
A plugin that integrates RuboCop Capybara with RuboCop’s plugin system.
Instance Method Summary collapse
-
#about ⇒ Object
:nocov:.
- #rules(_context) ⇒ Object
-
#supported?(context) ⇒ Boolean
:nocov:.
Instance Method Details
#about ⇒ Object
:nocov:
10 11 12 13 14 15 16 17 |
# File 'lib/rubocop/capybara/plugin.rb', line 10 def about LintRoller::About.new( name: 'rubocop-capybara', version: Version::STRING, homepage: 'https://github.com/rubocop/rubocop-capybara', description: 'Code style checking for Capybara test files.' ) end |
#rules(_context) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rubocop/capybara/plugin.rb', line 24 def rules(_context) project_root = Pathname.new(__dir__).join('../../..') obsoletion = project_root.join('config', 'obsoletion.yml') ConfigObsoletion.files << obsoletion if obsoletion.exist? LintRoller::Rules.new( type: :path, config_format: :rubocop, value: project_root.join('config/default.yml') ) end |
#supported?(context) ⇒ Boolean
:nocov:
20 21 22 |
# File 'lib/rubocop/capybara/plugin.rb', line 20 def supported?(context) context.engine == :rubocop end |