Skip to content

Commit

Permalink
Fix RuboCop 0.50 errors
Browse files Browse the repository at this point in the history
Closes GH-158

Please note that Performance/HashEachMethods was a false positive.
  • Loading branch information
weppos committed Oct 3, 2017
1 parent 393c63a commit 3432077
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ inherit_from:
- .rubocop_todo.yml
- .rubocop_dnsimple.yml

AllCops:
Exclude:
- '*.gemspec'
- 'Rakefile'

# [codesmell]
# It's irrelevant here, but it could be a code smell.
# Hence keep it disabled, but don't include it in the DNSimple suite.
Expand Down
14 changes: 7 additions & 7 deletions .rubocop_dnsimple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
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

# [codesmell]
# I don't really get the point of this cop.
Performance/RedundantMerge:
Expand Down Expand Up @@ -175,13 +182,6 @@ Style/NumericLiterals:
Style/PercentLiteralDelimiters:
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
Style/PredicateName:
Enabled: false

# Do we care?
Style/RegexpLiteral:
Enabled: false
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|
Dnsimple::Default.keys.each do |key| # rubocop:disable Performance/HashEachMethods
instance_variable_set(:"@#{key}", options[key] || defaults[key])
end

Expand Down
2 changes: 1 addition & 1 deletion lib/dnsimple/struct/extended_attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Option < Base
attr_accessor :required

# @return [Array<Options>] The array of options with possible values for the extended attribute
attr_accessor :options
attr_reader :options

def initialize(*)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/dnsimple/struct/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Setting < Base
attr_accessor :default_subdomain

# @return [Array<Settings>] The array of settings to setup this service, if setup is required.
attr_accessor :settings
attr_reader :settings

def initialize(*)
super
Expand Down
4 changes: 2 additions & 2 deletions lib/dnsimple/struct/whoami.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module Struct

class Whoami < Base
# @return [Account] The account, if present.
attr_accessor :account
attr_reader :account

# @return [String] The user, if present.
attr_accessor :user
attr_reader :user


# Converts account to a Struct::Account and sets it.
Expand Down

0 comments on commit 3432077

Please sign in to comment.