Skip to content

Commit

Permalink
Update rubocop requirement from 1.57.2 to 1.59.0 (#373)
Browse files Browse the repository at this point in the history
* Update rubocop requirement from 1.57.2 to 1.59.0

Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.57.2...v1.59.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix rubocop cops

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Simone Carletti <[email protected]>
  • Loading branch information
dependabot[bot] and weppos authored Jan 9, 2024
1 parent 0e4ff49 commit f839c32
Show file tree
Hide file tree
Showing 62 changed files with 167 additions and 167 deletions.
95 changes: 19 additions & 76 deletions .rubocop_dnsimple.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# Defaults https://github.com/bbatsov/rubocop/blob/master/config/default.yml
#
# References:
Expand All @@ -25,8 +24,8 @@ Layout/AccessModifierIndentation:
Layout/BlockEndNewline:
Enabled: false

# Generally, the keyword style uses a lot of space. This is particularly true
# when you use case/if statements, in combination with a long-name variable.
# Generally, the keyword style uses a lot of space. This is particularly true when
# you use case/if statements, in combination with a long-name variable.
#
# invoice_error_message = case error
# when 1 == 1
Expand Down Expand Up @@ -123,10 +122,9 @@ Naming/RescuedExceptionsVariableName:
Naming/MethodParameterName:
Enabled: false

# This cop returns false positive violations (as of rubocop 0.57.0)
# https://github.com/rubocop-hq/rubocop/issues/5953
Style/AccessModifierDeclarations:
Enabled: false
Style/AccessorGrouping:
Enabled: true
EnforcedStyle: separated

# Do not use "and" or "or" in conditionals, but for readability we can use it
# to chain executions. Just beware of operator order.
Expand All @@ -137,7 +135,7 @@ Style/AndOr:
Style/BarePercentLiterals:
EnforcedStyle: percent_q

# braces_for_chaining seems a good fit of what we've been doing so far.
# Pick one option for consistency.
Style/BlockDelimiters:
EnforcedStyle: braces_for_chaining
AllowedMethods:
Expand All @@ -147,22 +145,18 @@ Style/BlockDelimiters:
Style/EmptyElse:
EnforcedStyle: empty

# There is no specific preference for empty methods.
# One-line methods are not exceptionally nice in Ruby.
# Just ignore this cop for now.
# Pick one option for consistency.
Style/EmptyMethod:
Enabled: false
EnforcedStyle: expanded

# We don't care about the format style.
# In most cases we use %, but not at the point we want to enforce it
# as a convention in the entire code.
Style/FormatString:
Enabled: false

# Annotated tokens (like %<foo>s) are a good thing,
# but in most cases we don't need them.
# %s is a simpler and straightforward version that works in almost all cases.
# So don't complain.
# Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
# %s is a simpler and straightforward version that works in almost all cases. So don't complain.
Style/FormatStringToken:
Enabled: false

Expand All @@ -174,21 +168,6 @@ Style/HashSyntax:
# that looks nicer with the old rocket syntax.
- 'Rakefile'

# Enforces usage of Hash#each_key and Hash#each_value (vs. Hash#keys.each
# and Hash#values.each).
Style/HashEachMethods:
Enabled: true

# Enforce the use of Hash#TransformKeys introduced in Ruby 2.5 to transform
# Hash keys.
Style/HashTransformKeys:
Enabled: true

# Enforce the use of Hash#TransformValues introduced in Ruby 2.5 to transform
# Hash values.
Style/HashTransformValues:
Enabled: true

# We want to be able to decide when to use one-line if/unless modifiers.
Style/IfUnlessModifier:
Enabled: false
Expand Down Expand Up @@ -220,11 +199,6 @@ Style/NumericLiterals:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'

# For years, %w() has been the de-facto standard.
# A lot of libraries are using (). Switching to [] would be a nightmare.
Style/PercentLiteralDelimiters:
Enabled: false

# Enable but only for multiple returns value.
#
# return foo, bar
Expand All @@ -236,17 +210,7 @@ Style/PercentLiteralDelimiters:
Style/RedundantReturn:
AllowMultipleReturnValues: true

# Do we care?
Style/RegexpLiteral:
Enabled: false

# There are cases were the inline rescue is ok. We can either downgrade
# the severity, or rely on the developer judgement on a case-by-case basis.
Style/RescueModifier:
Enabled: false

# This is quite annoying, especially in cases where we don't control it
# (e.g. schema.rb).
# This is quite annoying, especially in cases where we don't control it (e.g. schema.rb).
Style/SymbolArray:
Enabled: false

Expand All @@ -261,9 +225,8 @@ Style/StringLiterals:
Enabled: false
EnforcedStyle: double_quotes

# As before.
# Pick one option for consistency.
Style/StringLiteralsInInterpolation:
Enabled: false
EnforcedStyle: double_quotes

# It's nice to be consistent. The trailing comma also allows easy reordering,
Expand All @@ -290,20 +253,8 @@ Style/WordArray:
EnforcedStyle: percent
MinSize: 3

# Forces the order of comparison arguments.
#
# According to this cop, the following statement is bad:
#
# "https" == uri.scheme
#
# Whereas the following is considered good:
#
# uri.scheme == "https"
Style/YodaCondition:
Enabled: false

# For the same reason of EndAlignment, aligning with the case may have
# a bad impact on a case after a very long variable.
# For the same reason of EndAlignment, aligning with the case may have a bad impact
# on a case after a very long variable.
#
# invoice_error_message = case error
# when 1 == 1
Expand All @@ -325,32 +276,24 @@ Layout/DotPosition:
Layout/EmptyLines:
Enabled: false

# This is buggy. It detects as a style violation a few `class`
# and `module` definitions
Layout/EmptyLinesAroundArguments:
Enabled: false

Layout/EmptyLinesAroundBlockBody:
Exclude:
# RSpec is all made of blocks. Disable this config in RSpec
# to be consistent with EmptyLinesAroundClassBody
# and EmptyLinesAroundModuleBody
# to be consistent with EmptyLinesAroundClassBody and EmptyLinesAroundModuleBody
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'

# In most cases, a space is nice. Sometimes, it's not.
# Just be consistent with the rest of the surrounding code.
# Pick one option for consistency. beginning+ending is the most used approach.
Layout/EmptyLinesAroundClassBody:
Enabled: false
EnforcedStyle: empty_lines_except_namespace

# We're ok with it. We use it quite often for method-level rescue statements.
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Enabled: false

# In most cases, a space is nice. Sometimes, it's not.
# Just be consistent with the rest of the surrounding code.
# Pick one option for consistency. beginning+ending is the most used approach.
Layout/EmptyLinesAroundModuleBody:
Enabled: false
EnforcedStyle: empty_lines_except_namespace

# This is quite buggy, as it doesn't recognize double lines.
Layout/EmptyLineBetweenDefs:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source 'https://rubygems.org'
gemspec

gem 'coveralls', require: false
gem 'rubocop', '1.57.2', require: false
gem 'rubocop', '1.59.0', require: false
gem 'rubocop-performance', '1.20.1', require: false
gem 'rubocop-rake', '0.6.0', require: false
gem 'rubocop-rspec', '2.25.0', require: false
1 change: 0 additions & 1 deletion lib/dnsimple/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require 'dnsimple/client/clients'

module Dnsimple

# Client for the DNSimple API
#
# @see https://developer.dnsimple.com/
Expand Down
2 changes: 2 additions & 0 deletions lib/dnsimple/client/billing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Dnsimple
class Client
module Billing

# List the billing charges for the account.
#
# @see https://developer.dnsimple.com/v2/billing/#listCharges
Expand Down Expand Up @@ -30,6 +31,7 @@ def charges(account_id, options = {})
Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Charge.new(r) })
end
alias list_charges charges

end
end
end
32 changes: 32 additions & 0 deletions lib/dnsimple/client/clients.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

module Dnsimple

class Client

# @return [Dnsimple::Client::AccountsService] The account-related API proxy.
Expand Down Expand Up @@ -117,26 +118,34 @@ def paginate(method, *args)
require_relative 'accounts'

class AccountsService < ClientService

include Client::Accounts

end

require_relative 'billing'

class BillingService < ClientService

include Client::Billing

end

require_relative 'certificates'

class CertificatesService < ClientService

include Client::Certificates

end


require_relative 'contacts'

class ContactsService < ClientService

include Client::Contacts

end


Expand All @@ -148,26 +157,32 @@ class ContactsService < ClientService
require_relative 'domains_collaborators'

class DomainsService < ClientService

include Client::Domains
include Client::DomainsDelegationSignerRecords
include Client::DomainsDnssec
include Client::DomainsEmailForwards
include Client::DomainsPushes
include Client::DomainsCollaborators

end


require_relative 'identity'

class IdentityService < ClientService

include Client::Identity

end


require_relative 'oauth'

class OauthService < ClientService

include Client::Oauth

end

require_relative 'registrar'
Expand All @@ -178,21 +193,25 @@ class OauthService < ClientService
require_relative 'registrar_delegation'

class RegistrarService < ClientService

include Client::Registrar
include Client::RegistrarAutoRenewal
include Client::RegistrarDelegation
include Client::RegistrarRegistrantChanges
include Client::RegistrarTransferLock
include Client::RegistrarWhoisPrivacy

end


require_relative 'services'
require_relative 'services_domains'

class ServicesService < ClientService

include Client::Services
include Client::ServicesDomains

end


Expand All @@ -201,23 +220,29 @@ class ServicesService < ClientService
require_relative 'templates_records'

class TemplatesService < ClientService

include Client::Templates
include Client::TemplatesDomains
include Client::TemplatesRecords

end


require_relative 'tlds'

class TldsService < ClientService

include Client::Tlds

end


require_relative 'vanity_name_servers'

class VanityNameServersService < ClientService

include Client::VanityNameServers

end


Expand All @@ -226,16 +251,20 @@ class VanityNameServersService < ClientService
require_relative 'zones_distributions'

class ZonesService < ClientService

include Client::Zones
include Client::ZonesRecords
include Client::ZonesDistributions

end


require_relative 'webhooks'

class WebhooksService < ClientService

include Client::Webhooks

end

end
Expand All @@ -246,6 +275,9 @@ class WebhooksService < ClientService
# these static methods return directly the underlying data objects.
# Therefore, it's not possible to access response metadata such as throttling or pagination info.
module V2

extend Client::Identity::StaticHelpers

end

end
1 change: 1 addition & 0 deletions lib/dnsimple/client/domains.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def delete_domain(account_id, domain_id, options = {})

Dnsimple::Response.new(response, nil)
end

end
end
end
Loading

0 comments on commit f839c32

Please sign in to comment.