Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

unscoped_variables

What it does

Checks for variables that are unscoped (don't have a local variable attached).

Why this is bad

Unscoped variables make code harder to read and debug, as well as making it harder for selene to analyze.

Configuration

ignore_pattern (default: "^_") - A regular expression for variables that are allowed to be unscoped. The default allows for variables like _ to be unscoped, as they shouldn't be used anyway.

Example

baz = 3