From 7d3242fed4057e2a89b70068b7e693f8fb149c88 Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Sat, 5 May 2018 02:12:01 +0200 Subject: [PATCH] update rubocop to 0.54.0 --- .rubocop.yml | 2 +- .rubocop_todo.yml | 17 ++++++++++++++++- .travis.yml | 2 -- Gemfile | 2 +- foreman_xen.gemspec | 2 +- lib/foreman_xen/engine.rb | 6 +++--- test/test_helper.rb | 4 ++-- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 489ee3f..6ea1b5b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_from: - .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.2 + TargetRubyVersion: 2.3 TargetRailsVersion: 5.1 Rails: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 77cfe68..8dc61ca 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-01-07 04:56:11 +0100 using RuboCop version 0.52.1. +# on 2018-05-05 02:13:49 +0200 using RuboCop version 0.54.0. # 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 @@ -74,6 +74,21 @@ Metrics/ParameterLists: Metrics/PerceivedComplexity: Max: 13 +# Offense count: 4 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: io, id, to +Naming/UncommunicativeMethodParamName: + Exclude: + - 'app/helpers/xen_compute_helper.rb' + - 'app/models/foreman_xen/xenserver.rb' + +# Offense count: 19 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: when_needed, always, never +Style/FrozenStringLiteralComment: + Enabled: false + # Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. diff --git a/.travis.yml b/.travis.yml index 8c3d2f9..920110c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ sudo: false language: ruby rvm: - - 2.1.5 - - 2.2.3 - 2.3.1 - 2.4.2 - 2.5.0 diff --git a/Gemfile b/Gemfile index ee415dd..3d57dd7 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,4 @@ source 'https://rubygems.org' gemspec -gem 'rubocop', '~> 0.52.1', require: false +gem 'rubocop', '~> 0.54.0', require: false diff --git a/foreman_xen.gemspec b/foreman_xen.gemspec index a1fb896..98c90d9 100644 --- a/foreman_xen.gemspec +++ b/foreman_xen.gemspec @@ -1,4 +1,4 @@ -$LOAD_PATH.push File.expand_path('../lib', __FILE__) +$LOAD_PATH.push File.expand_path('lib', __dir__) # Maintain your gem's version: require 'foreman_xen/version' diff --git a/lib/foreman_xen/engine.rb b/lib/foreman_xen/engine.rb index 3babe27..3b76f05 100644 --- a/lib/foreman_xen/engine.rb +++ b/lib/foreman_xen/engine.rb @@ -9,7 +9,7 @@ class Engine < ::Rails::Engine engine_name 'foreman_xen' initializer 'foreman_xen.register_gettext', :after => :load_config_initializers do |app| - locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale') + locale_dir = File.join(File.expand_path('../..', __dir__), 'locale') locale_domain = 'foreman-xen' Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir @@ -43,8 +43,8 @@ class Engine < ::Rails::Engine begin # extend fog xen server and image models. require 'fog/compute/xen_server/models/server' - require File.expand_path('../../../app/models/concerns/fog_extensions/xenserver/server', __FILE__) - require File.expand_path('../../../app/models/concerns/foreman_xen/host_helper_extensions', __FILE__) + require File.expand_path('../../app/models/concerns/fog_extensions/xenserver/server', __dir__) + require File.expand_path('../../app/models/concerns/foreman_xen/host_helper_extensions', __dir__) Fog::Compute::XenServer::Server.send(:include, ::FogExtensions::Xenserver::Server) ::HostsHelper.send(:include, ForemanXen::HostHelperExtensions) diff --git a/test/test_helper.rb b/test/test_helper.rb index 63cb0c9..c404f18 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,7 @@ # Configure Rails Environment ENV['RAILS_ENV'] = 'test' -require File.expand_path('../dummy/config/environment.rb', __FILE__) +require File.expand_path('dummy/config/environment.rb', __dir__) require 'rails/test_help' Rails.backtrace_cleaner.remove_silencers! @@ -11,5 +11,5 @@ # Load fixtures from the engine if ActiveSupport::TestCase.method_defined?(:fixture_path=) - ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) + ActiveSupport::TestCase.fixture_path = File.expand_path('fixtures', __dir__) end