Skip to content

Commit 513f1dd

Browse files
authored
Merge pull request resque#1663 from jeremy/rubocop
Code style: basic whitespace lint
2 parents b1c64b5 + 7d586a2 commit 513f1dd

File tree

12 files changed

+39
-12
lines changed

12 files changed

+39
-12
lines changed

.rubocop.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Want to disable a check for a specific case? To disable checks inline:
2+
# http://docs.rubocop.org/en/latest/configuration/#disabling-cops-within-source-code
3+
4+
AllCops:
5+
TargetRubyVersion: 2.3
6+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
7+
# to ignore them, so only the ones explicitly set in this file are enabled.
8+
DisabledByDefault: true
9+
Exclude:
10+
- 'log/**/*'
11+
- 'vendor/**/*'
12+
13+
# Detect hard tabs, no hard tabs.
14+
Layout/Tab:
15+
Enabled: true
16+
17+
# Blank lines should not have any spaces.
18+
Layout/TrailingBlankLines:
19+
Enabled: true
20+
21+
# No trailing whitespace.
22+
Layout/TrailingWhitespace:
23+
Enabled: true

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ matrix:
1717
allow_failures:
1818
- rvm: ruby-head
1919
fast_finish: true
20+
include:
21+
- rvm: 2.3.8
22+
script: bundle exec rubocop

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ gem "minitest", "5.11.3"
88
gem "mocha", :require => false
99
gem "rack-test", "~> 0.5"
1010
gem "rake"
11+
gem "rubocop"
1112
gem "pry"
1213
gem "airbrake", require: false # to make airbrake backend test work

bin/resque-web

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ begin
66
rescue LoadError
77
require 'rubygems'
88
require 'vegas'
9-
end
9+
end
1010
require 'resque/server'
1111

1212

examples/demo/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ require 'resque/tasks'
44
require 'job'
55

66
desc "Start the demo using `rackup`"
7-
task :start do
7+
task :start do
88
exec "rackup config.ru"
99
end

examples/demo/app.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class App < Sinatra::Base
1515
out << '<input type="submit" value="Create New Job"/>'
1616
out << '&nbsp;&nbsp;<a href="/resque/">View Resque</a>'
1717
out << '</form>'
18-
18+
1919
out << "<form action='/failing' method='POST''>"
2020
out << '<input type="submit" value="Create Failing New Job"/>'
2121
out << '&nbsp;&nbsp;<a href="/resque/">View Resque</a>'
2222
out << '</form>'
23-
23+
2424
out << "</body></html>"
2525
out
2626
end
@@ -29,8 +29,8 @@ class App < Sinatra::Base
2929
Resque.enqueue(Job, params)
3030
redirect "/"
3131
end
32-
33-
post '/failing' do
32+
33+
post '/failing' do
3434
Resque.enqueue(FailingJob, params)
3535
redirect "/"
3636
end

examples/demo/job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.perform(params)
99
puts "Processed a job!"
1010
end
1111
end
12-
12+
1313
module FailingJob
1414
@queue = :failing
1515

lib/resque/failure/redis.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.count(queue = nil, class_name = nil)
3131

3232
if class_name
3333
n = 0
34-
each(0, count(queue), queue, class_name) { n += 1 }
34+
each(0, count(queue), queue, class_name) { n += 1 }
3535
n
3636
else
3737
data_store.num_failed

lib/resque/job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def self.encode(object)
4848
def self.decode(object)
4949
Resque.decode(object)
5050
end
51-
51+
5252
# Given a word with dashes, returns a camel cased version of it.
5353
def classify(dashed_word)
5454
Resque.classify(dashed_word)

lib/resque/logging.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Logging
77
def self.log(severity, message)
88
Resque.logger.__send__(severity, message) if Resque.logger
99
end
10-
10+
1111
# Log level aliases
1212
def debug(message); Logging.log :debug, message; end
1313
def info(message); Logging.log :info, message; end

0 commit comments

Comments
 (0)