Commit 6dfc9570dde2ab41a1a586f4182bddcf399324ae

Authored by Laust Rud Jacobsen
1 parent e27279cc
Exists in master and in 1 other branch production

Rubocop: percent literal delimiter unify

.rubocop_todo.yml
@@ -110,16 +110,6 @@ Style/IfUnlessModifier: @@ -110,16 +110,6 @@ Style/IfUnlessModifier:
110 Style/MultilineOperationIndentation: 110 Style/MultilineOperationIndentation:
111 Enabled: false 111 Enabled: false
112 112
113 -# Offense count: 5  
114 -# Cop supports --auto-correct.  
115 -# Configuration parameters: PreferredDelimiters.  
116 -Style/PercentLiteralDelimiters:  
117 - Exclude:  
118 - - 'app/controllers/api/v1/notices_controller.rb'  
119 - - 'app/controllers/api/v1/problems_controller.rb'  
120 - - 'app/controllers/problems_searcher.rb'  
121 - - 'spec/models/notice_spec.rb'  
122 -  
123 # Offense count: 1 113 # Offense count: 1
124 # Configuration parameters: Methods. 114 # Configuration parameters: Methods.
125 Style/SingleLineBlockParams: 115 Style/SingleLineBlockParams:
app/controllers/api/v1/notices_controller.rb
@@ -3,7 +3,7 @@ class Api::V1::NoticesController < ApplicationController @@ -3,7 +3,7 @@ class Api::V1::NoticesController < ApplicationController
3 3
4 def index 4 def index
5 query = {} 5 query = {}
6 - fields = %w{created_at message error_class} 6 + fields = %w(created_at message error_class)
7 7
8 if params.key?(:start_date) && params.key?(:end_date) 8 if params.key?(:start_date) && params.key?(:end_date)
9 start_date = Time.zone.parse(params[:start_date]).utc 9 start_date = Time.zone.parse(params[:start_date]).utc
app/controllers/api/v1/problems_controller.rb
1 class Api::V1::ProblemsController < ApplicationController 1 class Api::V1::ProblemsController < ApplicationController
2 respond_to :json, :xml 2 respond_to :json, :xml
3 - FIELDS = %w{_id app_id app_name environment message where first_notice_at last_notice_at resolved resolved_at notices_count} 3 + FIELDS = %w(_id app_id app_name environment message where first_notice_at last_notice_at resolved resolved_at notices_count)
4 4
5 def show 5 def show
6 result = benchmark("[api/v1/problems_controller/show] query time") do 6 result = benchmark("[api/v1/problems_controller/show] query time") do
app/controllers/problems_searcher.rb
@@ -6,7 +6,7 @@ module ProblemsSearcher @@ -6,7 +6,7 @@ module ProblemsSearcher
6 6
7 included do 7 included do
8 expose(:params_sort) { 8 expose(:params_sort) {
9 - if %w{app message last_notice_at last_deploy_at count}.member?(params[:sort]) 9 + if %w(app message last_notice_at last_deploy_at count).member?(params[:sort])
10 params[:sort] 10 params[:sort]
11 else 11 else
12 "last_notice_at" 12 "last_notice_at"
@@ -14,7 +14,7 @@ module ProblemsSearcher @@ -14,7 +14,7 @@ module ProblemsSearcher
14 } 14 }
15 15
16 expose(:params_order) { 16 expose(:params_order) {
17 - if %w{asc desc}.member?(params[:order]) 17 + if %w(asc desc).member?(params[:order])
18 params[:order] 18 params[:order]
19 else 19 else
20 'desc' 20 'desc'