Class: RuboCop::Cop::Discourse::Plugins::NamespaceConstants
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Discourse::Plugins::NamespaceConstants
- Defined in:
- lib/rubocop/cop/discourse/plugins/namespace_constants.rb
Overview
Constants must be defined inside the plugin namespace (module or class).
Constant Summary collapse
- MSG =
"Don’t define constants outside a class or a module."
Instance Method Summary collapse
Instance Method Details
#on_casgn(node) ⇒ Object
21 22 23 24 |
# File 'lib/rubocop/cop/discourse/plugins/namespace_constants.rb', line 21 def on_casgn(node) return if inside_namespace?(node) add_offense(node, message: MSG) end |