Skip to content

Commit 9458a50

Browse files
authored
Merge pull request #72 from dblock/upgrade-rubocop
Upgrade rubocop to 0.55.0.
2 parents 85912c0 + bb6f767 commit 9458a50

File tree

20 files changed

+96
-89
lines changed

20 files changed

+96
-89
lines changed

.rubocop.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
Metrics:
2+
Enabled: false
3+
4+
Metrics/LineLength:
5+
Max: 500
6+
Enabled: false
7+
8+
Style/Documentation:
9+
Enabled: false
10+
11+
Style/FrozenStringLiteralComment:
12+
Enabled: false
13+
114
inherit_from: .rubocop_todo.yml
215

.rubocop_todo.yml

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,42 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2016-07-01 09:34:39 +0100 using RuboCop version 0.40.0.
3+
# on 2018-05-06 23:29:13 -0400 using RuboCop version 0.55.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
Lint/RescueException:
9+
# Offense count: 3
10+
# Cop supports --auto-correct.
11+
# Configuration parameters: EnforcedStyle.
12+
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
13+
Layout/IndentHeredoc:
1114
Exclude:
12-
- 'lib/slack-ruby-bot-server/app.rb'
13-
14-
# Offense count: 9
15-
Metrics/AbcSize:
16-
Max: 33
17-
18-
# Offense count: 1
19-
# Configuration parameters: CountComments.
20-
Metrics/ClassLength:
21-
Max: 117
15+
- 'lib/slack-ruby-bot-server/info.rb'
16+
- 'sample_apps/sample_app_activerecord/commands/help.rb'
17+
- 'sample_apps/sample_app_mongoid/commands/help.rb'
2218

2319
# Offense count: 2
24-
Metrics/CyclomaticComplexity:
25-
Max: 11
26-
27-
# Offense count: 68
28-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
29-
# URISchemes: http, https
30-
Metrics/LineLength:
31-
Max: 163
32-
33-
# Offense count: 8
34-
# Configuration parameters: CountComments.
35-
Metrics/MethodLength:
36-
Max: 23
37-
38-
# Offense count: 2
39-
Metrics/PerceivedComplexity:
40-
Max: 11
41-
42-
# Offense count: 25
43-
Style/Documentation:
44-
Enabled: false
45-
46-
# Offense count: 2
47-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
48-
Style/FileName:
20+
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
21+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
22+
Naming/FileName:
4923
Exclude:
5024
- 'lib/slack-ruby-bot-server.rb'
5125
- 'lib/slack-ruby-bot-server/ext/slack-ruby-bot.rb'
5226

27+
# Offense count: 3
28+
# Configuration parameters: Blacklist.
29+
# Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
30+
Naming/HeredocDelimiterNaming:
31+
Exclude:
32+
- 'lib/slack-ruby-bot-server/info.rb'
33+
- 'sample_apps/sample_app_activerecord/commands/help.rb'
34+
- 'sample_apps/sample_app_mongoid/commands/help.rb'
35+
5336
# Offense count: 1
37+
# Cop supports --auto-correct.
38+
# Configuration parameters: EnforcedStyle.
39+
# SupportedStyles: module_function, extend_self
5440
Style/ModuleFunction:
5541
Exclude:
5642
- 'lib/slack-ruby-bot-server/config.rb'

Gemfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ source 'https://rubygems.org'
22

33
case ENV['DATABASE_ADAPTER']
44
when 'mongoid' then
5-
gem 'mongoid'
65
gem 'kaminari-mongoid'
6+
gem 'mongoid'
77
gem 'mongoid-scroll'
88
when 'activerecord' then
9-
gem 'pg'
109
gem 'activerecord', '~> 5.0.0'
1110
gem 'otr-activerecord', '~> 1.2.1'
12-
gem 'cursor_pagination'
11+
gem 'cursor_pagination' # rubocop:disable Bundler/OrderedGems
12+
gem 'pg'
1313
when nil then
1414
warn "Missing ENV['DATABASE_ADAPTER']."
1515
else
@@ -19,23 +19,23 @@ end
1919
gemspec
2020

2121
group :development, :test do
22-
gem 'rack-server-pages'
2322
gem 'bundler'
24-
gem 'rake'
25-
gem 'rspec'
26-
gem 'rubocop', '0.40.0'
2723
gem 'byebug'
28-
gem 'mongoid-shell'
29-
gem 'heroku'
30-
gem 'rack-test'
31-
gem 'webmock'
32-
gem 'vcr'
24+
gem 'capybara', '~> 2.15.1'
25+
gem 'database_cleaner'
3326
gem 'fabrication'
3427
gem 'faker'
35-
gem 'database_cleaner'
28+
gem 'heroku'
3629
gem 'hyperclient'
37-
gem 'capybara', '~> 2.15.1'
30+
gem 'mongoid-shell'
31+
gem 'rack-server-pages'
32+
gem 'rack-test'
33+
gem 'rake'
34+
gem 'rspec'
35+
gem 'rubocop', '0.55.0'
3836
gem 'selenium-webdriver', '~> 3.4.4'
37+
gem 'vcr'
38+
gem 'webmock'
3939
end
4040

4141
group :test do

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ end
1111
require 'rubocop/rake_task'
1212
RuboCop::RakeTask.new
1313

14-
task default: [:rubocop, :spec]
14+
task default: %i[rubocop spec]
1515

1616
import 'tasks/db.rake'

lib/slack-ruby-bot-server/api/helpers/pagination_parameters.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module PaginationParameters
1212
mutually_exclusive :offset, :cursor
1313
end
1414

15-
ALL = %w(cursor size sort offset total_count).freeze
15+
ALL = %w[cursor size sort offset total_count].freeze
1616
end
1717
end
1818
end

lib/slack-ruby-bot-server/api/middleware.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ def self.logger
1515

1616
def self.instance
1717
@instance ||= Rack::Builder.new do
18-
if SlackRubyBotServer::Config.activerecord? && defined?(::OTR)
19-
use OTR::ActiveRecord::ConnectionManagement
20-
end
18+
use OTR::ActiveRecord::ConnectionManagement if SlackRubyBotServer::Config.activerecord? && defined?(::OTR)
2119

2220
use Rack::Cors do
2321
allow do
2422
origins '*'
25-
resource '*', headers: :any, methods: [:get, :post]
23+
resource '*', headers: :any, methods: %i[get post]
2624
end
2725
end
2826

lib/slack-ruby-bot-server/ext.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
%w(bson/object_id grape/sort_extension slack-ruby-bot).each do |ext|
1+
%w[bson/object_id grape/sort_extension slack-ruby-bot].each do |ext|
22
require_relative "ext/#{ext}"
33
end
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
source 'https://rubygems.org'
22

3-
gem 'pg'
43
gem 'activerecord', '~> 5.0.0', require: 'active_record'
5-
gem 'slack-ruby-bot-server', path: '../../'
64
gem 'newrelic-slack-ruby-bot'
5+
gem 'otr-activerecord', '~> 1.2.1'
6+
gem 'pg'
77
gem 'rack-server-pages'
88
gem 'rack-test'
9-
gem 'otr-activerecord', '~> 1.2.1'
9+
gem 'slack-ruby-bot-server', path: '../../'
1010

1111
group :development, :test do
12-
gem 'standalone_migrations'
12+
gem 'standalone_migrations', '~> 5.2'
1313
end
1414

1515
group :test do
16-
gem 'rake'
17-
gem 'rspec'
16+
gem 'database_cleaner'
1817
gem 'fabrication'
1918
gem 'faker'
19+
gem 'rake'
20+
gem 'rspec'
2021
gem 'vcr'
2122
gem 'webmock'
22-
gem 'database_cleaner'
2323
end

sample_apps/sample_app_activerecord/Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'rubygems'
2+
require 'bundler/setup'
23

34
require 'rspec/core'
45
require 'rspec/core/rake_task'

sample_apps/sample_app_activerecord/spec/api/root_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def app
1111
get '/api'
1212
expect(last_response.status).to eq 200
1313
links = JSON.parse(last_response.body)['_links']
14-
expect(links.keys.sort).to eq(%w(self status team teams).sort)
14+
expect(links.keys.sort).to eq(%w[self status team teams].sort)
1515
end
1616
end

0 commit comments

Comments
 (0)