Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade rubocop, stop testing ruby 2.1 #217

Merged
merged 2 commits into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ AllCops:
- vendor/**/*
- lib/slack/web/api/slack-api-ref/**/*

Metrics:
Enabled: false

Metrics/LineLength:
Max: 512

Style/Documentation:
Enabled: false

Naming/MethodName:
Enabled: false

Expand Down
84 changes: 38 additions & 46 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-08-17 04:23:36 +0000 using RuboCop version 0.51.0.
# on 2018-08-20 07:57:38 -0400 using RuboCop version 0.58.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -14,58 +14,38 @@ Lint/HandleExceptions:
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'

# Offense count: 1
Lint/RescueWithoutErrorClass:
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/slack/real_time/concurrency/celluloid.rb'

# Offense count: 22
Metrics/AbcSize:
Max: 44

# Offense count: 84
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 421
- 'lib/slack/logger.rb'

# Offense count: 2
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 166

# Offense count: 4
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 864
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 372

# Offense count: 10
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 42
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip
Naming/UncommunicativeMethodParamName:
Exclude:
- 'spec/support/queue_with_timeout.rb'

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 113

# Offense count: 4
Metrics/PerceivedComplexity:
Max: 11
Security/Open:
Exclude:
- 'lib/slack/real_time/client.rb'

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# 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
Naming/FileName:
# Offense count: 2
# Configuration parameters: EnforcedStyle.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Exclude:
- 'lib/slack-ruby-client.rb'
- 'lib/slack/real_time/concurrency/eventmachine.rb'
- 'lib/slack/real_time/socket.rb'

# Offense count: 69
Style/Documentation:
Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
Style/ExpandPathArguments:
Exclude:
- 'bin/slack'
- 'slack-ruby-client.gemspec'

# Offense count: 152
# Configuration parameters: AllowedVariables.
Expand All @@ -79,8 +59,14 @@ Style/GuardClause:
- 'lib/slack/real_time/stores/store.rb'
- 'lib/slack/web/faraday/response/raise_error.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'bin/slack'

# Offense count: 3
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: module_function, extend_self
Style/ModuleFunction:
Exclude:
Expand All @@ -92,3 +78,9 @@ Style/ModuleFunction:
Style/MultilineTernaryOperator:
Exclude:
- 'spec/support/real_time/connected_client.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RandomWithOffset:
Exclude:
- 'spec/integration/integration_spec.rb'
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ cache: bundler

rvm:
- 2.2
- 2.1
- 2.3.4
- 2.3
- 2.5
- ruby-head
- jruby-head

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* [#207](https://github.com/slack-ruby/slack-ruby-client/pull/207): Added `apps_permissions_resources_list` and `apps_permissions_scopes_list` - [@jmanian](https://github.com/jmanian).
* [#207](https://github.com/slack-ruby/slack-ruby-client/pull/207): Added `users_conversations` - [@jmanian](https://github.com/jmanian).
* [#206](https://github.com/slack-ruby/slack-ruby-client/pull/206): Fix 100% cpu usage in async examples - [@felixbuenemann](https://github.com/felixbuenemann).
* [#217](https://github.com/slack-ruby/slack-ruby-client/pull/217): Upgraded RuboCop to 0.58.2 - [@dblock](https://github.com/dblock).
* [#217](https://github.com/slack-ruby/slack-ruby-client/pull/217): No longer tested with Ruby 2.1, added 2.5 - [@dblock](https://github.com/dblock).

### 0.11.1 (1/23/2018)

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source 'http://rubygems.org'
gemspec

gem ENV['CONCURRENCY'], require: false if ENV.key?('CONCURRENCY')
# rubocop:enable Bundler/OrderedGems

gem 'activesupport', '~> 4.0'
gem 'picky' unless RUBY_PLATFORM == 'java'
Expand Down
1 change: 0 additions & 1 deletion lib/slack/messages/formatting.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module Slack
module Messages
module Formatting
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/real_time/concurrency/celluloid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run_loop
ensure
begin
current_actor.terminate if current_actor.alive?
rescue
rescue StandardError
nil
end
end
Expand Down
2 changes: 1 addition & 1 deletion slack-ruby-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'json-schema'
s.add_development_dependency 'rake', '~> 10'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rubocop', '0.51.0'
s.add_development_dependency 'rubocop', '0.58.2'
s.add_development_dependency 'vcr'
s.add_development_dependency 'webmock'
end
1 change: 0 additions & 1 deletion spec/slack/messages/formatting_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

require 'spec_helper'

describe Slack::Messages::Formatting do
Expand Down
14 changes: 8 additions & 6 deletions spec/slack/web/api/mixins/channels_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
klass.new
end
before do
allow(subject).to receive(:channels_list).and_return(Slack::Messages::Message.new(
'channels' => [{
'id' => 'CDEADBEEF',
'name' => 'general'
}]
))
allow(subject).to receive(:channels_list).and_return(
Slack::Messages::Message.new(
'channels' => [{
'id' => 'CDEADBEEF',
'name' => 'general'
}]
)
)
end
context '#channels_id' do
it 'leaves channels specified by ID alone' do
Expand Down
14 changes: 8 additions & 6 deletions spec/slack/web/api/mixins/groups_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
klass.new
end
before do
allow(subject).to receive(:groups_list).and_return(Slack::Messages::Message.new(
'groups' => [{
'id' => 'CDEADBEEF',
'name' => 'general'
}]
))
allow(subject).to receive(:groups_list).and_return(
Slack::Messages::Message.new(
'groups' => [{
'id' => 'CDEADBEEF',
'name' => 'general'
}]
)
)
end
context '#groups_id' do
it 'leaves groups specified by ID alone' do
Expand Down
16 changes: 9 additions & 7 deletions spec/slack/web/api/mixins/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
klass.new
end
before do
allow(subject).to receive(:users_list).and_return(Slack::Messages::Message.new(
'members' => [{
'id' => 'UDEADBEEF',
'name' => 'aws',
'profile' => {}
}]
))
allow(subject).to receive(:users_list).and_return(
Slack::Messages::Message.new(
'members' => [{
'id' => 'UDEADBEEF',
'name' => 'aws',
'profile' => {}
}]
)
)
end
context '#users_id' do
it 'leaves users specified by ID alone' do
Expand Down