Skip to content

Commit

Permalink
Update Rubocop to 1.28.x
Browse files Browse the repository at this point in the history
This is the last Ruby 2.5 compatible version.
  • Loading branch information
ekohl committed Sep 15, 2022
1 parent e867bf6 commit 3c0e8ca
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
12 changes: 10 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-performance
- rubocop-rake

AllCops:
NewCops: enable
TargetRubyVersion: 2.5
Exclude:
- 'test/**/*'
Expand All @@ -9,6 +14,9 @@ AllCops:
Metrics:
Enabled: false

Gemspec/RequireMFA:
Enabled: false

Layout/LeadingCommentSpace:
Enabled: false

Expand Down Expand Up @@ -109,10 +117,10 @@ Style/EmptyMethod:
Style/ParenthesesAroundCondition:
Enabled: false

Layout/AlignHash:
Layout/HashAlignment:
Enabled: false

Layout/AlignParameters:
Layout/ParameterAlignment:
Enabled: false

# disabled until we can configure "+" as concat sign
Expand Down
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
source 'https://rubygems.org'
gemspec

gem 'webrick'

group :rubocop do
gem 'rubocop', '~> 1.28.0'
gem 'rubocop-performance'
gem 'rubocop-rake'
end

group :test do
gem 'ci_reporter_test_unit'
gem 'concurrent-ruby', '~> 1.0', require: 'concurrent'
Expand Down
2 changes: 1 addition & 1 deletion lib/smart_proxy_dhcp_infoblox/ip_address_arithmetic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def ipv4_to_i(an_address)
an_address.split('.').inject(0) { |a, c| (a << 8) + c.to_i }
end

def i_to_ipv4(i)
def i_to_ipv4(i) # rubocop:todo Naming/MethodParameterName
(0..3).inject([]) { |a, c| a.push((i >> (c * 8)) & 0xFF) }.reverse.join('.')
end

Expand Down
2 changes: 1 addition & 1 deletion lib/smart_proxy_dhcp_infoblox/plugin_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def load_classes
require 'smart_proxy_dhcp_infoblox/dhcp_infoblox_main'
end

def load_dependency_injection_wirings(c, settings)
def load_dependency_injection_wirings(c, settings) # rubocop:todo Naming/MethodParameterName
c.dependency :connection, (lambda {
::Infoblox.wapi_version = '2.0'
::Infoblox::Connection.new(:username => settings[:username], :password => settings[:password],
Expand Down
2 changes: 0 additions & 2 deletions smart_proxy_dhcp_infoblox.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.5'

s.add_runtime_dependency('infoblox', '~> 3.0')

s.add_development_dependency('rubocop', '~> 0.50.0')
end

0 comments on commit 3c0e8ca

Please sign in to comment.