Enable rubocop Performance/RedundantMatch cop & fix issues
Some cop offenses have been stashed into rubocop_todo.yml for now
This commit is contained in:
@@ -85,6 +85,9 @@ Performance/RangeInclude:
|
||||
Performance/RedundantBlockCall:
|
||||
Enabled: true
|
||||
|
||||
Performance/RedundantMatch:
|
||||
Enabled: true
|
||||
|
||||
Performance/RedundantMerge:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2018-02-10 21:08:01 +0100 using RuboCop version 0.52.1.
|
||||
# on 2018-02-10 21:25:09 +0100 using RuboCop version 0.52.1.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
@@ -23,6 +23,13 @@ Layout/IndentationConsistency:
|
||||
Metrics/LineLength:
|
||||
Max: 248
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
Performance/RedundantMatch:
|
||||
Exclude:
|
||||
- 'app/controllers/valuation/budget_investments_controller.rb'
|
||||
- 'app/controllers/valuation/spending_proposals_controller.rb'
|
||||
|
||||
# Offense count: 11
|
||||
RSpec/DescribeClass:
|
||||
Exclude:
|
||||
|
||||
@@ -6,9 +6,9 @@ module EmbedVideosHelper
|
||||
def embedded_video_code
|
||||
link = @proposal.video_url
|
||||
title = t('proposals.show.embed_video_title', proposal: @proposal.title)
|
||||
if link.match(/vimeo.*/)
|
||||
if link =~ /vimeo.*/
|
||||
server = "Vimeo"
|
||||
elsif link.match(/youtu*.*/)
|
||||
elsif link =~ /youtu*.*/
|
||||
server = "YouTube"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user