Skip to content

Commit

Permalink
Update Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Apr 23, 2018
1 parent 310df8e commit cb07ced
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
22 changes: 20 additions & 2 deletions .rubocop_dnsimple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Bundler/OrderedGems:
# do_else
# end
#
Lint/EndAlignment:
Layout/EndAlignment:
EnforcedStyleAlignWith: variable

# [codesmell]
Expand Down Expand Up @@ -84,13 +84,26 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

# We tend to use @_name to represent a variable that is memoized,
# but it should not be accessed directly and kept as private.
Naming/MemoizedInstanceVariableName:
Enabled: false

# We use it from time to time, as it's not always possible (or maintainable)
# to use simple ? methods.
# Moreover, it's actually more efficient to not-use predicates:
# https://github.com/bbatsov/rubocop/issues/3633
Naming/PredicateName:
Enabled: false

# This cop triggers several false positives that make sense in our domain model.
# For instance, ip is considered an uncommunicative parameter name:
#
# ipv4_to_arpa_name(ip)
#
Naming/UncommunicativeMethodParamName:
Enabled: false

# [codesmell]
# I don't really get the point of this cop.
Performance/RedundantMerge:
Expand Down Expand Up @@ -229,7 +242,12 @@ Style/StringLiteralsInInterpolation:

# It's nice to be consistent. The trailing comma also allows easy reordering,
# and doesn't cause a diff in Git when you add a line to the bottom.
Style/TrailingCommaInLiteral:
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma

# It's nice to be consistent. The trailing comma also allows easy reordering,
# and doesn't cause a diff in Git when you add a line to the bottom.
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma

Style/TrivialAccessors:
Expand Down
2 changes: 1 addition & 1 deletion lib/dnsimple/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.versioned(path)
def initialize(options = {})
defaults = Dnsimple::Default.options

Dnsimple::Default.keys.each do |key| # rubocop:disable Performance/HashEachMethods
Dnsimple::Default.keys.each do |key|
instance_variable_set(:"@#{key}", options[key] || defaults[key])
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require 'dnsimple'

unless defined?(SPEC_ROOT)
SPEC_ROOT = File.expand_path("../", __FILE__)
SPEC_ROOT = File.expand_path(__dir__)
end

Dir[File.join(SPEC_ROOT, "support/**/*.rb")].each { |f| require f }

0 comments on commit cb07ced

Please sign in to comment.