You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ rubocop foo.rb
Inspecting 1 file
W
Offenses:
foo.rb:4:3: W: [Correctable] Lint/Void: Literal '' used in void context.
''
^^
1 file inspected, 1 offense detected, 1 offense autocorrectable
In this example, we see that the '' on the first line of the example method reports a Lint/Void violation.
Describe the solution you'd like
The '' inside the if is also useless—it would be nice to have a rule which catches problems like this. This sort of code usually indicates that someone expected to be assigning '' to a variable, but no assignment is happening.
Describe alternatives you've considered
One solution would be adding this to Lint/Void.
Another solution would be creating a new rule for this.
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Version
foo.rb
Output
In this example, we see that the
''
on the first line of theexample
method reports aLint/Void
violation.Describe the solution you'd like
The
''
inside theif
is also useless—it would be nice to have a rule which catches problems like this. This sort of code usually indicates that someone expected to be assigning''
to a variable, but no assignment is happening.Describe alternatives you've considered
One solution would be adding this to
Lint/Void
.Another solution would be creating a new rule for this.
Additional context
n/a
The text was updated successfully, but these errors were encountered: