Class: RuboCop::Cop::SketchupRequirements::RegisterExtension
- Inherits:
-
SketchUp::Cop
- Object
- SketchUp::WorkaroundCop
- SketchUp::Cop
- RuboCop::Cop::SketchupRequirements::RegisterExtension
- Includes:
- SketchUp::NoCommentDisable
- Defined in:
- lib/rubocop/sketchup/cop/requirements/register_extension.rb
Overview
Always register extensions to load by default. Otherwise it might confuse users to think the extension isn’t working.
Constant Summary collapse
- MSG =
'Always register extensions to load by default.'
Constants inherited from SketchUp::Cop
SketchUp::Cop::SKETCHUP_DEPARTMENT_SEVERITY
Constants included from SketchUp::Config
SketchUp::Config::DEFAULT_CONFIGURATION
Instance Method Summary collapse
Methods inherited from SketchUp::Cop
Instance Method Details
#on_send(node) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rubocop/sketchup/cop/requirements/register_extension.rb', line 29 def on_send(node) sketchup_register_extension(node).each { |args| if args.size < 2 add_offense(node, location: :selector) next end load_arg = args[1] next if load_arg.true_type? add_offense(load_arg) } end |