Commit ed97fdfecd5b77a19bfa30197710788f6d489a33

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

Rubocop: strip out errant extra spaces

Still allowing for internal alignment across lines.
@@ -11,3 +11,6 @@ Rails/FindBy: @@ -11,3 +11,6 @@ Rails/FindBy:
11 11
12 Style/EmptyLineBetweenDefs: 12 Style/EmptyLineBetweenDefs:
13 AllowAdjacentOneLineDefs: true 13 AllowAdjacentOneLineDefs: true
  14 +
  15 +Style/ExtraSpacing:
  16 + AllowForAlignment: true
.rubocop_todo.yml
@@ -147,12 +147,6 @@ Style/EachWithObject: @@ -147,12 +147,6 @@ Style/EachWithObject:
147 - 'app/models/notice_fingerprinter.rb' 147 - 'app/models/notice_fingerprinter.rb'
148 - 'lib/recurse.rb' 148 - 'lib/recurse.rb'
149 149
150 -# Offense count: 22  
151 -# Cop supports --auto-correct.  
152 -# Configuration parameters: AllowForAlignment.  
153 -Style/ExtraSpacing:  
154 - Enabled: false  
155 -  
156 # Offense count: 2 150 # Offense count: 2
157 # Configuration parameters: Exclude. 151 # Configuration parameters: Exclude.
158 Style/FileName: 152 Style/FileName:
@@ -29,7 +29,7 @@ gem 'htmlentities' @@ -29,7 +29,7 @@ gem 'htmlentities'
29 gem 'kaminari', '>= 0.14.1' 29 gem 'kaminari', '>= 0.14.1'
30 gem 'mongoid', '5.0.0' 30 gem 'mongoid', '5.0.0'
31 gem 'mongoid_rails_migrations' 31 gem 'mongoid_rails_migrations'
32 -gem 'rack-ssl', :require => 'rack/ssl' # force SSL 32 +gem 'rack-ssl', :require => 'rack/ssl' # force SSL
33 gem 'rack-ssl-enforcer', :require => false 33 gem 'rack-ssl-enforcer', :require => false
34 gem 'rails_autolink' 34 gem 'rails_autolink'
35 gem 'useragent' 35 gem 'useragent'
@@ -104,7 +104,7 @@ group :heroku, :production do @@ -104,7 +104,7 @@ group :heroku, :production do
104 gem 'unicorn', require: false, platform: 'ruby' 104 gem 'unicorn', require: false, platform: 'ruby'
105 end 105 end
106 106
107 -gem 'therubyracer', :platform => :ruby # C Ruby (MRI) or Rubinius, but NOT Windows 107 +gem 'therubyracer', :platform => :ruby # C Ruby (MRI) or Rubinius, but NOT Windows
108 gem 'sass-rails' 108 gem 'sass-rails'
109 gem 'uglifier' 109 gem 'uglifier'
110 # We can't upgrade because not compatible to jquery >= 1.9. 110 # We can't upgrade because not compatible to jquery >= 1.9.
app/controllers/api/v1/notices_controller.rb
@@ -17,7 +17,7 @@ class Api::V1::NoticesController < ApplicationController @@ -17,7 +17,7 @@ class Api::V1::NoticesController < ApplicationController
17 17
18 respond_to do |format| 18 respond_to do |format|
19 format.any(:html, :json) { render :json => JSON.dump(results) } # render JSON if no extension specified on path 19 format.any(:html, :json) { render :json => JSON.dump(results) } # render JSON if no extension specified on path
20 - format.xml { render :xml => results } 20 + format.xml { render :xml => results }
21 end 21 end
22 end 22 end
23 end 23 end
app/controllers/api/v1/problems_controller.rb
@@ -14,7 +14,7 @@ class Api::V1::ProblemsController < ApplicationController @@ -14,7 +14,7 @@ class Api::V1::ProblemsController < ApplicationController
14 14
15 respond_to do |format| 15 respond_to do |format|
16 format.any(:html, :json) { render :json => result } # render JSON if no extension specified on path 16 format.any(:html, :json) { render :json => result } # render JSON if no extension specified on path
17 - format.xml { render :xml => result } 17 + format.xml { render :xml => result }
18 end 18 end
19 end 19 end
20 20
@@ -33,7 +33,7 @@ class Api::V1::ProblemsController < ApplicationController @@ -33,7 +33,7 @@ class Api::V1::ProblemsController < ApplicationController
33 33
34 respond_to do |format| 34 respond_to do |format|
35 format.any(:html, :json) { render :json => JSON.dump(results) } # render JSON if no extension specified on path 35 format.any(:html, :json) { render :json => JSON.dump(results) } # render JSON if no extension specified on path
36 - format.xml { render :xml => results } 36 + format.xml { render :xml => results }
37 end 37 end
38 end 38 end
39 end 39 end
app/controllers/api/v1/stats_controller.rb
@@ -19,7 +19,7 @@ class Api::V1::StatsController < ApplicationController @@ -19,7 +19,7 @@ class Api::V1::StatsController < ApplicationController
19 19
20 respond_to do |format| 20 respond_to do |format|
21 format.any(:html, :json) { render :json => JSON.dump(stats) } # render JSON if no extension specified on path 21 format.any(:html, :json) { render :json => JSON.dump(stats) } # render JSON if no extension specified on path
22 - format.xml { render :xml => stats } 22 + format.xml { render :xml => stats }
23 end 23 end
24 end 24 end
25 25
app/helpers/apps_helper.rb
@@ -42,10 +42,10 @@ module AppsHelper @@ -42,10 +42,10 @@ module AppsHelper
42 @any_github_repos = @any_issue_trackers = @any_deploys = @any_bitbucket_repos = @any_notification_services = false 42 @any_github_repos = @any_issue_trackers = @any_deploys = @any_bitbucket_repos = @any_notification_services = false
43 43
44 apps.each do |app| 44 apps.each do |app|
45 - @any_github_repos ||= app.github_repo?  
46 - @any_bitbucket_repos ||= app.bitbucket_repo?  
47 - @any_issue_trackers ||= app.issue_tracker_configured?  
48 - @any_deploys ||= app.last_deploy_at.present? 45 + @any_github_repos ||= app.github_repo?
  46 + @any_bitbucket_repos ||= app.bitbucket_repo?
  47 + @any_issue_trackers ||= app.issue_tracker_configured?
  48 + @any_deploys ||= app.last_deploy_at.present?
49 @any_notification_services ||= app.notification_service_configured? 49 @any_notification_services ||= app.notification_service_configured?
50 end 50 end
51 end 51 end
app/helpers/form_helper.rb
@@ -3,7 +3,7 @@ module FormHelper @@ -3,7 +3,7 @@ module FormHelper
3 return unless document.errors.any? 3 return unless document.errors.any?
4 4
5 content_tag(:div, :class => 'error-messages') do 5 content_tag(:div, :class => 'error-messages') do
6 - body = content_tag(:h2, 'Dang. The following errors are keeping this from being a success.') 6 + body = content_tag(:h2, 'Dang. The following errors are keeping this from being a success.')
7 body + content_tag(:ul) do 7 body + content_tag(:ul) do
8 document.errors.full_messages.inject('') {|errs, msg| errs + content_tag(:li, h(msg)) }.html_safe 8 document.errors.full_messages.inject('') {|errs, msg| errs + content_tag(:li, h(msg)) }.html_safe
9 end 9 end
app/mailers/mailer.rb
@@ -28,8 +28,8 @@ class Mailer < ActionMailer::Base @@ -28,8 +28,8 @@ class Mailer < ActionMailer::Base
28 end 28 end
29 29
30 def deploy_notification(deploy) 30 def deploy_notification(deploy)
31 - @deploy = deploy  
32 - @app = AppDecorator.new deploy.app 31 + @deploy = deploy
  32 + @app = AppDecorator.new deploy.app
33 33
34 errbit_headers 'App' => @app.name, 34 errbit_headers 'App' => @app.name,
35 'Environment' => @deploy.environment, 35 'Environment' => @deploy.environment,
app/models/issue_tracker.rb
@@ -22,7 +22,7 @@ class IssueTracker @@ -22,7 +22,7 @@ class IssueTracker
22 end 22 end
23 23
24 def type_tracker 24 def type_tracker
25 - attributes['type_tracker'] ? attributes['type_tracker'] : 'none' 25 + attributes['type_tracker'] ? attributes['type_tracker'] : 'none'
26 end 26 end
27 27
28 # Allow the tracker to validate its own params 28 # Allow the tracker to validate its own params
app/models/notification_services/gtalk_service.rb
@@ -46,7 +46,7 @@ class NotificationServices::GtalkService < NotificationService @@ -46,7 +46,7 @@ class NotificationServices::GtalkService < NotificationService
46 client.auth(api_token) 46 client.auth(api_token)
47 47
48 #has to look like this to be formatted properly in the client 48 #has to look like this to be formatted properly in the client
49 - message = """#{problem.app.name} 49 + message = """#{problem.app.name}
50 #{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id} 50 #{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id}
51 #{notification_description problem}""" 51 #{notification_description problem}"""
52 52
1 #!/usr/bin/env ruby 1 #!/usr/bin/env ruby
2 # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 2 # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 3
4 -APP_PATH = File.expand_path('../../config/application', __FILE__)  
5 -require File.expand_path('../../config/boot', __FILE__) 4 +APP_PATH = File.expand_path('../../config/application', __FILE__)
  5 +require File.expand_path('../../config/boot', __FILE__)
6 require 'rails/commands' 6 require 'rails/commands'
1 # This file is used by Rack-based servers to start the application. 1 # This file is used by Rack-based servers to start the application.
2 2
3 -require ::File.expand_path('../config/environment', __FILE__) 3 +require ::File.expand_path('../config/environment', __FILE__)
4 use Rack::Deflater 4 use Rack::Deflater
5 run Rails.application 5 run Rails.application
config/routes.rb
@@ -20,7 +20,7 @@ Rails.application.routes.draw do @@ -20,7 +20,7 @@ Rails.application.routes.draw do
20 end 20 end
21 end 21 end
22 22
23 - resources :problems, :only => [:index] do 23 + resources :problems, :only => [:index] do
24 collection do 24 collection do
25 post :destroy_several 25 post :destroy_several
26 post :resolve_several 26 post :resolve_several
lib/hoptoad.rb
@@ -18,7 +18,7 @@ module Hoptoad @@ -18,7 +18,7 @@ module Hoptoad
18 def self.get_version_processor(version) 18 def self.get_version_processor(version)
19 case version 19 case version
20 when /2\.[01234]/ then Hoptoad::V2 20 when /2\.[01234]/ then Hoptoad::V2
21 - else; raise ApiVersionError 21 + else; raise ApiVersionError
22 end 22 end
23 end 23 end
24 end 24 end
spec/fabricators/app_fabricator.rb
@@ -12,7 +12,7 @@ end @@ -12,7 +12,7 @@ end
12 Fabricator(:watcher) do 12 Fabricator(:watcher) do
13 app 13 app
14 watcher_type 'email' 14 watcher_type 'email'
15 - email { sequence(:email){|n| "email#{n}@example.com"} } 15 + email { sequence(:email){|n| "email#{n}@example.com"} }
16 end 16 end
17 17
18 Fabricator(:user_watcher, :from => :watcher) do 18 Fabricator(:user_watcher, :from => :watcher) do
spec/fabricators/comment_fabricator.rb
1 Fabricator :comment do 1 Fabricator :comment do
2 user 2 user
3 - body 'Test comment' 3 + body 'Test comment'
4 err(:fabricator => :problem) 4 err(:fabricator => :problem)
5 end 5 end
6 6
spec/fabricators/notification_service_fabricator.rb
1 -Fabricator :notification_service do 1 +Fabricator :notification_service do
2 app 2 app
3 room_id { sequence :word } 3 room_id { sequence :word }
4 api_token { sequence :word } 4 api_token { sequence :word }
spec/mailers/mailer_spec.rb
@@ -51,7 +51,7 @@ describe Mailer do @@ -51,7 +51,7 @@ describe Mailer do
51 p.notices_count = 3 51 p.notices_count = 3
52 p 52 p
53 end 53 end
54 - let!(:user) { Fabricate(:admin) } 54 + let!(:user) { Fabricate(:admin) }
55 let(:error_report) do 55 let(:error_report) do
56 instance_double( 56 instance_double(
57 'ErrorReport', 57 'ErrorReport',