Skip to content

Files

Latest commit

 

History

History
50 lines (36 loc) · 660 Bytes

Lint-ShadowedArgument.md

File metadata and controls

50 lines (36 loc) · 660 Bytes

Pattern: Shadowed argument

Issue: -

Description

This rule checks for arguments that were shadowed by local variables before they were used.

Examples

# bad

do_something do |foo|
  foo = 42
  puts foo
end

def do_something(foo)
  foo = 42
  puts foo
end
# good

do_something do |foo|
  foo = foo + 42
  puts foo
end

def do_something(foo)
  foo = foo + 42
  puts foo
end

def do_something(foo)
  puts foo
end

Default configuration

Attribute Value
IgnoreImplicitReferences false

Further Reading