File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 22
33## master (unreleased)
44
5+ ### Bug fixes
6+
7+ [ #3513 ] ( https://github.com/bbatsov/rubocop/pull/3513 ) : Fix false positive in ` Style/TernaryParentheses ` for a ternary with ranges. ([ @dreyks ] [ ] )
8+
59## 0.43.0 (2016-09-19)
610
711### New features
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ def redundant_parentheses_enabled?
9191 end
9292
9393 def parenthesized? ( node )
94- node . source =~ /^ \( .* \) $/
94+ node . begin_type?
9595 end
9696
9797 # When this cop is configured to enforce parentheses and the
Original file line number Diff line number Diff line change 168168 'foo = (baz.foo? bar, baz) ? a : b'
169169 end
170170 end
171+
172+ context 'with condition including a range' do
173+ it_behaves_like 'code without offense' ,
174+ '(foo..bar).include?(baz) ? a : b'
175+ end
171176 end
172177
173178 context 'when `RedundantParenthesis` would cause an infinite loop' do
You can’t perform that action at this time.
0 commit comments