Skip to content

Commit

Permalink
Add a rule about stabby lambdas with params
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Jul 9, 2015
1 parent 09fc57f commit a304bd6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,19 @@ condition](#safe-assignment-in-condition).
end
```

* <a name="stabby-lambda-with-args"></a>
Don't omit the parameter parentheses when defining a stabby lambda with
parameters.
<sup>[[link](#stabby-lambda-with-args)]</sup>

```Ruby
# bad
l = ->x, y { something(x, y) }

# good
l = ->(x, y) { something(x, y) }
```

* <a name="stabby-lambda-no-args"></a>
Omit the parameter parentheses when defining a stabby lambda with
no parameters.
Expand Down Expand Up @@ -1925,7 +1938,7 @@ no parameters.
class SomeXML
...
end

class XMLSomething
...
end
Expand Down

0 comments on commit a304bd6

Please sign in to comment.