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.
.rubocop.yml
... ... @@ -11,3 +11,6 @@ Rails/FindBy:
11 11  
12 12 Style/EmptyLineBetweenDefs:
13 13 AllowAdjacentOneLineDefs: true
  14 +
  15 +Style/ExtraSpacing:
  16 + AllowForAlignment: true
... ...
.rubocop_todo.yml
... ... @@ -147,12 +147,6 @@ Style/EachWithObject:
147 147 - 'app/models/notice_fingerprinter.rb'
148 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 150 # Offense count: 2
157 151 # Configuration parameters: Exclude.
158 152 Style/FileName:
... ...
Gemfile
... ... @@ -29,7 +29,7 @@ gem 'htmlentities'
29 29 gem 'kaminari', '>= 0.14.1'
30 30 gem 'mongoid', '5.0.0'
31 31 gem 'mongoid_rails_migrations'
32   -gem 'rack-ssl', :require => 'rack/ssl' # force SSL
  32 +gem 'rack-ssl', :require => 'rack/ssl' # force SSL
33 33 gem 'rack-ssl-enforcer', :require => false
34 34 gem 'rails_autolink'
35 35 gem 'useragent'
... ... @@ -104,7 +104,7 @@ group :heroku, :production do
104 104 gem 'unicorn', require: false, platform: 'ruby'
105 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 108 gem 'sass-rails'
109 109 gem 'uglifier'
110 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 17  
18 18 respond_to do |format|
19 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 21 end
22 22 end
23 23 end
... ...
app/controllers/api/v1/problems_controller.rb
... ... @@ -14,7 +14,7 @@ class Api::V1::ProblemsController < ApplicationController
14 14  
15 15 respond_to do |format|
16 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 18 end
19 19 end
20 20  
... ... @@ -33,7 +33,7 @@ class Api::V1::ProblemsController < ApplicationController
33 33  
34 34 respond_to do |format|
35 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 37 end
38 38 end
39 39 end
... ...
app/controllers/api/v1/stats_controller.rb
... ... @@ -19,7 +19,7 @@ class Api::V1::StatsController < ApplicationController
19 19  
20 20 respond_to do |format|
21 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 23 end
24 24 end
25 25  
... ...
app/helpers/apps_helper.rb
... ... @@ -42,10 +42,10 @@ module AppsHelper
42 42 @any_github_repos = @any_issue_trackers = @any_deploys = @any_bitbucket_repos = @any_notification_services = false
43 43  
44 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 49 @any_notification_services ||= app.notification_service_configured?
50 50 end
51 51 end
... ...
app/helpers/form_helper.rb
... ... @@ -3,7 +3,7 @@ module FormHelper
3 3 return unless document.errors.any?
4 4  
5 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 7 body + content_tag(:ul) do
8 8 document.errors.full_messages.inject('') {|errs, msg| errs + content_tag(:li, h(msg)) }.html_safe
9 9 end
... ...
app/mailers/mailer.rb
... ... @@ -28,8 +28,8 @@ class Mailer < ActionMailer::Base
28 28 end
29 29  
30 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 34 errbit_headers 'App' => @app.name,
35 35 'Environment' => @deploy.environment,
... ...
app/models/issue_tracker.rb
... ... @@ -22,7 +22,7 @@ class IssueTracker
22 22 end
23 23  
24 24 def type_tracker
25   - attributes['type_tracker'] ? attributes['type_tracker'] : 'none'
  25 + attributes['type_tracker'] ? attributes['type_tracker'] : 'none'
26 26 end
27 27  
28 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 46 client.auth(api_token)
47 47  
48 48 #has to look like this to be formatted properly in the client
49   - message = """#{problem.app.name}
  49 + message = """#{problem.app.name}
50 50 #{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id}
51 51 #{notification_description problem}"""
52 52  
... ...
bin/rails
1 1 #!/usr/bin/env ruby
2 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 6 require 'rails/commands'
... ...
config.ru
1 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 4 use Rack::Deflater
5 5 run Rails.application
... ...
config/routes.rb
... ... @@ -20,7 +20,7 @@ Rails.application.routes.draw do
20 20 end
21 21 end
22 22  
23   - resources :problems, :only => [:index] do
  23 + resources :problems, :only => [:index] do
24 24 collection do
25 25 post :destroy_several
26 26 post :resolve_several
... ...
lib/hoptoad.rb
... ... @@ -18,7 +18,7 @@ module Hoptoad
18 18 def self.get_version_processor(version)
19 19 case version
20 20 when /2\.[01234]/ then Hoptoad::V2
21   - else; raise ApiVersionError
  21 + else; raise ApiVersionError
22 22 end
23 23 end
24 24 end
... ...
spec/fabricators/app_fabricator.rb
... ... @@ -12,7 +12,7 @@ end
12 12 Fabricator(:watcher) do
13 13 app
14 14 watcher_type 'email'
15   - email { sequence(:email){|n| "email#{n}@example.com"} }
  15 + email { sequence(:email){|n| "email#{n}@example.com"} }
16 16 end
17 17  
18 18 Fabricator(:user_watcher, :from => :watcher) do
... ...
spec/fabricators/comment_fabricator.rb
1 1 Fabricator :comment do
2 2 user
3   - body 'Test comment'
  3 + body 'Test comment'
4 4 err(:fabricator => :problem)
5 5 end
6 6  
... ...
spec/fabricators/notification_service_fabricator.rb
1   -Fabricator :notification_service do
  1 +Fabricator :notification_service do
2 2 app
3 3 room_id { sequence :word }
4 4 api_token { sequence :word }
... ...
spec/mailers/mailer_spec.rb
... ... @@ -51,7 +51,7 @@ describe Mailer do
51 51 p.notices_count = 3
52 52 p
53 53 end
54   - let!(:user) { Fabricate(:admin) }
  54 + let!(:user) { Fabricate(:admin) }
55 55 let(:error_report) do
56 56 instance_double(
57 57 'ErrorReport',
... ...