Class: RuboCop::Cop::SketchupRequirements::LanguageHandlerGlobals
- Inherits:
-
SketchUp::Cop
- Object
- SketchUp::WorkaroundCop
- SketchUp::Cop
- RuboCop::Cop::SketchupRequirements::LanguageHandlerGlobals
- Includes:
- SketchUp::NoCommentDisable
- Defined in:
- lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb
Overview
Avoid using globals in general, but especially these which are known to be in use by other extensions made by SketchUp. They are still in use due to compatibility reasons.
Constant Summary collapse
- MSG =
'Avoid globals in general, but especially these which are known '\ 'to be in use.'
- LH_GLOBALS =
%i[ $dc_strings $devl_strings $exStrings $fs_strings $make_pano_string $oceanStrings $sn_strings $ssf_strings $suStrings $tStrings $unitsStrings $uStrings $wt_strings ].freeze
Constants included from SketchUp::Config
SketchUp::Config::DEFAULT_CONFIGURATION
Instance Method Summary collapse
Methods inherited from SketchUp::Cop
Instance Method Details
#hl_global_var?(global_var) ⇒ Boolean
32 33 34 |
# File 'lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb', line 32 def hl_global_var?(global_var) LH_GLOBALS.include?(global_var) end |
#on_gvasgn(node) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/rubocop/sketchup/cop/requirements/language_handler_globals.rb', line 36 def on_gvasgn(node) global_var, = *node return unless hl_global_var?(global_var) add_offense(node, location: :name) end |