Class: RuboCop::Cop::EightyFourCodes::Cop Abstract

Inherits:
WorkaroundCop84
  • Object
show all
Includes:
EightyFourCodes::Language, EightyFourCodes::Language::NodePattern
Defined in:
lib/rubocop/cop/eightyfourcodes/cop.rb

Overview

This class is abstract.

parent class to rspec cops

The criteria for whether rubocop-rspec analyzes a certain ruby file is configured via ‘AllCops/RSpec`. For example, if you want to customize your project to scan all files within a `test/` directory then you could add this to your configuration:

Examples:

configuring analyzed paths


AllCops:
  RSpec:
    Patterns:
    - '_test.rb$'
    - '(?:^|/)test/'

Constant Summary collapse

DEFAULT_CONFIGURATION =
RuboCop::EightyFourCodes::CONFIG.fetch('AllCops').fetch('EightyFourCodes')

Constants included from EightyFourCodes::Language

EightyFourCodes::Language::ALL

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(subclass) ⇒ Object

Invoke the original inherited hook so our cops are recognized



43
44
45
# File 'lib/rubocop/cop/eightyfourcodes/cop.rb', line 43

def self.inherited(subclass)
  RuboCop::Cop::Cop.inherited(subclass)
end

Instance Method Details

#relevant_file?(file) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/rubocop/cop/eightyfourcodes/cop.rb', line 47

def relevant_file?(file)
  relevant_rubocop_rspec_file?(file) && super
end