Skip to content
Closed
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
10 changes: 4 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ Style/CaseIndentation:
Style/IndentHash:
EnforcedStyle: consistent

Style/TrailingComma:
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma

Style/TrivialAccessors:
AllowPredicates: true

# TODO: remove when we end support for < 1.9.3

Style/HashSyntax:
EnforcedStyle: hash_rockets

Style/Lambda:
Enabled: false
108 changes: 89 additions & 19 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,145 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2015-09-06 13:16:09 -0400 using RuboCop version 0.34.0.
# on 2017-11-25 22:16:44 -0500 using RuboCop version 0.41.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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
Metrics/AbcSize:
Max: 93
Max: 90

# Offense count: 1
Metrics/BlockNesting:
Max: 5

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 125

# Offense count: 2
Metrics/CyclomaticComplexity:
Max: 30

# Offense count: 290
# Configuration parameters: AllowURI, URISchemes.
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 232

# Offense count: 5
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 60
Max: 57

# Offense count: 1
Metrics/PerceivedComplexity:
Max: 27

# Offense count: 40
# Cop supports --auto-correct.
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
Exclude:
- 'spec/mysql2/client_spec.rb'
- 'spec/mysql2/statement_spec.rb'

# Cop supports --auto-correct.
Performance/TimesMap:
Exclude:
- 'benchmark/active_record_threaded.rb'
- 'examples/threaded.rb'
- 'spec/mysql2/client_spec.rb'

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: prefer_alias, prefer_alias_method
Style/Alias:
Exclude:
- 'lib/mysql2/error.rb'

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
# SupportedStyles: line_count_based, semantic, braces_for_chaining
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
# FunctionalMethods: let, let!, subject, watch
# IgnoredMethods: lambda, proc, it
Style/BlockDelimiters:
Enabled: false
Exclude:
- 'spec/em/em_spec.rb'
- 'spec/mysql2/client_spec.rb'
- 'spec/mysql2/result_spec.rb'
- 'spec/mysql2/statement_spec.rb'

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/mysql2/client.rb'
- 'support/ruby_enc_to_mysql.rb'

# Offense count: 12
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'benchmark/active_record.rb'
- 'benchmark/allocations.rb'
- 'benchmark/query_with_mysql_casting.rb'
- 'lib/mysql2.rb'
- 'lib/mysql2/client.rb'
- 'lib/mysql2/em.rb'
- 'lib/mysql2/error.rb'
- 'lib/mysql2/field.rb'
- 'lib/mysql2/result.rb'
- 'lib/mysql2/statement.rb'
- 'lib/mysql2/version.rb'

# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: when_needed, always
Style/FrozenStringLiteralComment:
Enabled: false

# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'ext/mysql2/extconf.rb'

# Offense count: 14
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'spec/mysql2/client_spec.rb'

# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
Style/HashSyntax:
EnforcedStyle: hash_rockets

Style/IfInsideElse:
Exclude:
- 'tasks/compile.rake'

# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'ext/mysql2/extconf.rb'
- 'lib/mysql2/version.rb'
- 'tasks/rspec.rake'
- 'tasks/vendor_mysql.rake'

# Cop supports --auto-correct.
Style/NumericLiterals:
MinDigits: 20

# Offense count: 680
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: only_raise, only_fail, semantic
Style/SignalException:
Exclude:
- 'lib/mysql2/client.rb'
- 'spec/em/em_spec.rb'

# Cop supports --auto-correct.
Style/SpaceInsidePercentLiteralDelimiters:
Exclude:
- 'spec/mysql2/client_spec.rb'

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'rake-compiler', '~> 1.0'
group :test do
gem 'eventmachine' unless RUBY_PLATFORM =~ /mswin|mingw/
gem 'rspec', '~> 3.2'
gem 'rubocop', '~> 0.34.0'
gem 'rubocop', '~> 0.41.2'
end

group :benchmarks do
Expand Down