Class: RuboCop::SketchUp::Cop Abstract

Inherits:
WorkaroundCop
  • Object
show all
Includes:
Config
Defined in:
lib/rubocop/sketchup/cop.rb

Overview

This class is abstract.

parent class to SketchUp cops

The criteria for whether rubocop-sketchup analyzes a certain ruby file is configured via ‘AllCops/SketchUp`. 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:
  SketchUp:
    SketchupDeprecations:
      Exclude:
      - '_test.rb$'
      - '(?:^|/)test/'

Direct Known Subclasses

Cop::SketchupBugs::MaterialName, Cop::SketchupBugs::RenderMode, Cop::SketchupBugs::UniformScaling, Cop::SketchupDeprecations::AddSeparatorToMenu, Cop::SketchupDeprecations::OperationNextTransparent, Cop::SketchupDeprecations::RequireAll, Cop::SketchupDeprecations::SetTextureProjection, Cop::SketchupDeprecations::ShowRubyPanel, Cop::SketchupDeprecations::SketchupSet, Cop::SketchupPerformance::OpenSSL, Cop::SketchupPerformance::OperationDisableUI, Cop::SketchupPerformance::SelectionBulkChanges, Cop::SketchupPerformance::TypeCheck, Cop::SketchupPerformance::Typename, Cop::SketchupRequirements::ApiNamespace, Cop::SketchupRequirements::Exit, Cop::SketchupRequirements::ExtensionNamespace, Cop::SketchupRequirements::FileStructure, Cop::SketchupRequirements::GemInstall, Cop::SketchupRequirements::GetExtensionLicense, Cop::SketchupRequirements::GlobalConstants, Cop::SketchupRequirements::GlobalInclude, Cop::SketchupRequirements::GlobalMethods, Cop::SketchupRequirements::GlobalVariables, Cop::SketchupRequirements::LanguageHandlerGlobals, Cop::SketchupRequirements::LoadPath, Cop::SketchupRequirements::MinimalRegistration, Cop::SketchupRequirements::ObserversStartOperation, Cop::SketchupRequirements::RegisterExtension, Cop::SketchupRequirements::RubyCoreNamespace, Cop::SketchupRequirements::RubyStdLibNamespace, Cop::SketchupRequirements::ShippedExtensionsNamespace, Cop::SketchupRequirements::SketchupExtension, Cop::SketchupRequirements::SketchupRequire, Cop::SketchupSuggestions::Compatibility, Cop::SketchupSuggestions::DynamicComponentInternals, Cop::SketchupSuggestions::FileEncoding, Cop::SketchupSuggestions::ModelEntities, Cop::SketchupSuggestions::MonkeyPatchedApi, Cop::SketchupSuggestions::OperationName, Cop::SketchupSuggestions::SketchupFindSupportFile

Constant Summary collapse

SKETCHUP_DEPARTMENT_SEVERITY =
{
  SketchupRequirements: :error,
  SketchupDeprecations: :warning,
  SketchupPerformance: :warning,
  SketchupBugs: :warning,
  SketchupSuggestions: :convention,
}.freeze

Constants included from Config

RuboCop::SketchUp::Config::DEFAULT_CONFIGURATION

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(subclass) ⇒ Object

Invoke the original inherited hook so our cops are recognized



54
55
56
# File 'lib/rubocop/sketchup/cop.rb', line 54

def self.inherited(subclass) # rubocop:disable Lint/MissingSuper
  RuboCop::Cop::Cop.inherited(subclass)
end

Instance Method Details

#relevant_file?(file) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/rubocop/sketchup/cop.rb', line 58

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