mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Safely autocorrect Style/RedundantRegexpArgument
Inspecting 1513 files
...........................................................................................................................................................................................................................................................................................................................................................C....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
app/models/spree/shipping_method.rb:69:25: C: [Corrected] Style/RedundantRegexpArgument: Use string ":tracking" as argument instead of regexp /:tracking/.
tracking_url.gsub(/:tracking/, tracking) unless tracking.blank? || tracking_url.blank?
^^^^^^^^^^^
lib/spree/i18n.rb:36:17: C: [Corrected] Style/RedundantRegexpArgument: Use string "spree" as argument instead of regexp /spree/.
path.gsub(/spree/, '')
^^^^^^^
1513 files inspected, 2 offenses detected, 2 offenses corrected
This commit is contained in:
@@ -937,13 +937,6 @@ Style/RedundantInterpolation:
|
||||
- 'lib/tasks/karma.rake'
|
||||
- 'spec/base_spec_helper.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/RedundantRegexpArgument:
|
||||
Exclude:
|
||||
- 'app/models/spree/shipping_method.rb'
|
||||
- 'lib/spree/i18n.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowMultipleReturnValues.
|
||||
|
||||
@@ -66,7 +66,7 @@ module Spree
|
||||
end
|
||||
|
||||
def build_tracking_url(tracking)
|
||||
tracking_url.gsub(/:tracking/, tracking) unless tracking.blank? || tracking_url.blank?
|
||||
tracking_url.gsub(":tracking", tracking) unless tracking.blank? || tracking_url.blank?
|
||||
end
|
||||
|
||||
# Some shipping methods are only meant to be set via backend
|
||||
|
||||
@@ -33,7 +33,7 @@ module Spree
|
||||
|
||||
return unless path
|
||||
|
||||
path.gsub(/spree/, '')
|
||||
path.gsub("spree", '')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user