Skip to content

Files

Latest commit

 

History

History
40 lines (28 loc) · 929 Bytes

Style-GlobalVars.md

File metadata and controls

40 lines (28 loc) · 929 Bytes

Pattern: Use of custom global variable

Issue: -

Description

This rule looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Examples

# bad
$foo_bar = 1

# good
module Foo
  class << self
    attr_accessor :bar
  end
end

Foo.bar = 1

Default configuration

Attribute Value
AllowedVariables

Further Reading