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 #100

Merged
merged 1 commit into from Apr 6, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions .rubocop.yml
Expand Up @@ -25,6 +25,9 @@ Metrics/AbcSize:
Metrics/BlockNesting:
Enabled: false

Metrics/BlockLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Expand Down Expand Up @@ -55,11 +58,17 @@ Style/Documentation:
Style/DoubleNegation:
Enabled: false

Style/EmptyLineAfterMagicComment:
Enabled: false

Style/EmptyLines:
Exclude:
- 'lib/active_record_shards-3-2.rb'
- 'lib/active_record_shards-5-0.rb'

Style/EmptyMethod:
EnforcedStyle: expanded

Style/FileName:
Exclude:
- 'lib/active_record_shards-3-2.rb'
Expand All @@ -75,17 +84,14 @@ Style/FormatString:
Style/GuardClause:
Enabled: false

Style/HashSyntax:
EnforcedStyle: ruby19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wut ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Style/IfUnlessModifier:
Enabled: false

Style/IndentHash:
EnforcedStyle: consistent

Style/IndentationWidth:
Width: 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/IndentHeredoc:
Enabled: false

Style/NumericLiterals:
Enabled: false
Expand All @@ -96,5 +102,8 @@ Style/SingleLineBlockParams:
Style/StringLiterals:
Enabled: false

Style/SymbolArray:
Enabled: false

Style/WordArray:
Enabled: false
2 changes: 1 addition & 1 deletion active_record_shards.gemspec
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new "active_record_shards", "3.9.1" do |s|
s.add_development_dependency("rake", '~> 12.0')
s.add_development_dependency("mysql2")
s.add_development_dependency("bump")
s.add_development_dependency("rubocop", "0.42.0")
s.add_development_dependency("rubocop", "0.48.1")
s.add_development_dependency("minitest")
s.add_development_dependency("minitest-rg")
s.add_development_dependency("mocha")
Expand Down
2 changes: 1 addition & 1 deletion test/configuration_parser_test.rb
Expand Up @@ -4,7 +4,7 @@
describe ActiveRecordShards::ConfigurationParser do
describe "exploding the database.yml" do
before do
@exploded_conf = ActiveRecordShards::ConfigurationParser.explode(YAML.load(IO.read(File.dirname(__FILE__) + '/database_parse_test.yml')))
@exploded_conf = ActiveRecordShards::ConfigurationParser.explode(YAML.safe_load(IO.read(File.dirname(__FILE__) + '/database_parse_test.yml')))
end

describe "main slave" do
Expand Down
4 changes: 2 additions & 2 deletions test/connection_switching_test.rb
Expand Up @@ -340,8 +340,8 @@ class ShardedModel < ActiveRecord::Base
Account.create!
assert_using_master_db

assert_equal Account.count, ActiveRecord::Base.on_slave { Account.count }
assert_equal Account.count, Account.on_slave { Account.count }
assert_equal(Account.count, ActiveRecord::Base.on_slave { Account.count })
assert_equal(Account.count, Account.on_slave { Account.count })
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/models.rb
Expand Up @@ -12,7 +12,7 @@ class AccountThing < ActiveRecord::Base
not_sharded

if respond_to?(:where)
scope :enabled, -> { where(enabled: true) }
scope(:enabled, -> { where(enabled: true) })
else
named_scope :enabled, conditions: { enabled: true }
end
Expand Down