Skip to content

Commit

Permalink
Fix documentation of Style/TernaryParentheses (rubocop#3970)
Browse files Browse the repository at this point in the history
Good and bad are not paired.
  • Loading branch information
onk authored and bbatsov committed Jan 25, 2017
1 parent 1f59c20 commit 0293ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/rubocop/cop/style/ternary_parentheses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Style
#
# @bad
# foo = (bar?) ? a : b
# foo = (bar.baz) ? a : b
# foo = (bar.baz?) ? a : b
# foo = (bar && baz) ? a : b
#
# @good
Expand All @@ -32,7 +32,7 @@ module Style
#
# @good
# foo = (bar?) ? a : b
# foo = (bar.baz) ? a : b
# foo = (bar.baz?) ? a : b
# foo = (bar && baz) ? a : b
#
# @example
Expand All @@ -46,7 +46,7 @@ module Style
#
# @good
# foo = bar? ? a : b
# foo = bar.baz ? a : b
# foo = bar.baz? ? a : b
# foo = (bar && baz) ? a : b
class TernaryParentheses < Cop
include SafeAssignment
Expand Down
6 changes: 3 additions & 3 deletions manual/cops_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -5138,7 +5138,7 @@ EnforcedStyle: require_no_parentheses (default)

# bad
foo = (bar?) ? a : b
foo = (bar.baz) ? a : b
foo = (bar.baz?) ? a : b
foo = (bar && baz) ? a : b

# good
Expand All @@ -5156,7 +5156,7 @@ foo = bar && baz ? a : b

# good
foo = (bar?) ? a : b
foo = (bar.baz) ? a : b
foo = (bar.baz?) ? a : b
foo = (bar && baz) ? a : b
```
```ruby
Expand All @@ -5169,7 +5169,7 @@ foo = bar && baz ? a : b

# good
foo = bar? ? a : b
foo = bar.baz ? a : b
foo = bar.baz? ? a : b
foo = (bar && baz) ? a : b
```

Expand Down

0 comments on commit 0293ef2

Please sign in to comment.