Class: RuboCop::Cop::SketchupRequirements::GlobalConstants
- Inherits:
-
SketchUp::Cop
- Object
- SketchUp::WorkaroundCop
- SketchUp::Cop
- RuboCop::Cop::SketchupRequirements::GlobalConstants
- Includes:
- SketchUp, SketchUp::NoCommentDisable
- Defined in:
- lib/rubocop/sketchup/cop/requirements/global_constants.rb
Constant Summary collapse
- MSG =
'Do not introduce global constants.'.freeze
Constants included from SketchUp
SketchUp::CONFIG, SketchUp::VERSION
Constants included from SketchUp::Config
SketchUp::Config::DEFAULT_CONFIGURATION
Instance Method Summary collapse
-
#on_casgn(node) ⇒ Object
Constant assignment.
Methods inherited from SketchUp::Cop
Instance Method Details
#on_casgn(node) ⇒ Object
Constant assignment.
20 21 22 23 24 |
# File 'lib/rubocop/sketchup/cop/requirements/global_constants.rb', line 20 def on_casgn(node) return if namespaced_constant?(node) namespace = Namespace.new(node.parent_module_name) add_offense(node, location: :name, severity: :error) if namespace.top_level? end |