Class: RuboCop::Cop::Yast::LogVariable

Inherits:
RuboCop::Cop show all
Defined in:
lib/rubocop/cop/yast/log_variable.rb

Overview

This cop checks for using log variable code like:

log = "msg"

can override the included logger

Constant Summary collapse

MSG =
"Do not use `log` variable, it can conflict with the logger."

Instance Method Summary collapse

Instance Method Details

#on_lvasgn(node) ⇒ Object



15
16
17
18
19
# File 'lib/rubocop/cop/yast/log_variable.rb', line 15

def on_lvasgn(node)
  name, _value = *node

  add_offense(node, :name, MSG) if name == :log
end