Skip to content

Commit

Permalink
fixes rubocop#52
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Oct 9, 2011
1 parent 931cf16 commit e61e9d4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -442,6 +442,23 @@ wkhtmltopdf can be installed in one of two methods
end
```

* Use spaces around the `=` operator when assigning default values to method parameters:

```Ruby
# bad
def some_method(arg1=:default, arg2=nil, arg3=[])
# do something...
end

# good
def some_method(arg1 = :default, arg2 = nil, arg3 = [])
# do something...
end
```

While several Ruby books suggest the first style, the second is much more prominent
in practice (and arguably a bit more readable).

* Avoid line continuation (\\) where not required. In practice, avoid using
line continuations at all.

Expand Down

0 comments on commit e61e9d4

Please sign in to comment.