Enable Style/ParenthesesAroundCondition cop
To prevent style check in review like https://github.com/rails/rails/pull/33608#discussion_r211087605.
This commit is contained in:
parent
9270c6d7fc
commit
b2c1e29c14
@ -176,6 +176,9 @@ Lint/StringConversionInInterpolation:
|
|||||||
Lint/UriEscapeUnescape:
|
Lint/UriEscapeUnescape:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/ParenthesesAroundCondition:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/RedundantReturn:
|
Style/RedundantReturn:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
AllowMultipleReturnValues: true
|
AllowMultipleReturnValues: true
|
||||||
|
@ -228,7 +228,7 @@ def excerpt(text, phrase, options = {})
|
|||||||
# pluralize(2, 'Person', locale: :de)
|
# pluralize(2, 'Person', locale: :de)
|
||||||
# # => 2 Personen
|
# # => 2 Personen
|
||||||
def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale)
|
def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale)
|
||||||
word = if (count == 1 || count =~ /^1(\.0+)?$/)
|
word = if count == 1 || count =~ /^1(\.0+)?$/
|
||||||
singular
|
singular
|
||||||
else
|
else
|
||||||
plural || singular.pluralize(locale)
|
plural || singular.pluralize(locale)
|
||||||
|
@ -9,7 +9,7 @@ def setup
|
|||||||
super
|
super
|
||||||
# This simulates the fact that instance variables are reset every time
|
# This simulates the fact that instance variables are reset every time
|
||||||
# a view is rendered. The cycle helper depends on this behavior.
|
# a view is rendered. The cycle helper depends on this behavior.
|
||||||
@_cycles = nil if (defined? @_cycles)
|
@_cycles = nil if defined?(@_cycles)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_concat
|
def test_concat
|
||||||
|
@ -34,7 +34,7 @@ def belongs_to_counter_cache_after_update(reflection)
|
|||||||
foreign_key = reflection.foreign_key
|
foreign_key = reflection.foreign_key
|
||||||
cache_column = reflection.counter_cache_column
|
cache_column = reflection.counter_cache_column
|
||||||
|
|
||||||
if (@_after_replace_counter_called ||= false)
|
if @_after_replace_counter_called ||= false
|
||||||
@_after_replace_counter_called = false
|
@_after_replace_counter_called = false
|
||||||
elsif association(reflection.name).target_changed?
|
elsif association(reflection.name).target_changed?
|
||||||
if reflection.polymorphic?
|
if reflection.polymorphic?
|
||||||
|
@ -12,8 +12,8 @@ def self.distance(str1, str2)
|
|||||||
n = s.length
|
n = s.length
|
||||||
m = t.length
|
m = t.length
|
||||||
|
|
||||||
return m if (0 == n)
|
return m if 0 == n
|
||||||
return n if (0 == m)
|
return n if 0 == m
|
||||||
|
|
||||||
d = (0..m).to_a
|
d = (0..m).to_a
|
||||||
x = nil
|
x = nil
|
||||||
|
@ -24,8 +24,8 @@ def levenshtein_distance(str1, str2) # :doc:
|
|||||||
n = s.length
|
n = s.length
|
||||||
m = t.length
|
m = t.length
|
||||||
|
|
||||||
return m if (0 == n)
|
return m if 0 == n
|
||||||
return n if (0 == m)
|
return n if 0 == m
|
||||||
|
|
||||||
d = (0..m).to_a
|
d = (0..m).to_a
|
||||||
x = nil
|
x = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user