How can I exclude a global variable from rubocop?

Viewed 4208

I want to exclude a global variable from rubocop but I'm not being able to find the rule name. I tried adding

GlobalVars:
  Exclude:
    - redis

to .rubocop.yml but no luck.

The error says Do not introduce global variables.

2 Answers

in .rubocop.yml:

GlobalVars:
  AllowedVariables:
    - $redis

Note that the variable name requires the leading dollar sign.

Related