Add and apply Style/RedundantCondition rule

This is a rule we generally follow all the time but accidentally forgot
in one place.
This commit is contained in:
Javi Martín
2021-08-09 19:20:07 +02:00
parent a102f3f0a7
commit 99bbad9b1e
2 changed files with 4 additions and 1 deletions

View File

@@ -455,6 +455,9 @@ Style/Proc:
Style/RaiseArgs:
Enabled: true
Style/RedundantCondition:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true

View File

@@ -34,7 +34,7 @@ module WelcomeHelper
def calculate_carousel_size(debates, proposals, apply_offset)
offset = calculate_offset(debates, proposals, apply_offset)
centered = calculate_centered(debates, proposals)
"#{offset if offset} #{centered if centered}"
"#{offset} #{centered}"
end
def calculate_centered(debates, proposals)