diff --git a/Gemfile b/Gemfile index 32efa661..25ec7347 100644 --- a/Gemfile +++ b/Gemfile @@ -29,9 +29,7 @@ group :development do end group :rubocop do - gem 'rubocop', '~> 1.50.0', require: false - gem 'rubocop-rspec', '~> 2.19', require: false + gem 'rubocop', '~> 1.64.0', require: false + gem 'rubocop-rspec', '~> 3.0', require: false gem 'rubocop-performance', '~> 1.16', require: false - gem 'rubocop-factory_bot', '!= 2.26.0', require: false - gem 'rubocop-rspec_rails', '!= 2.29.0', require: false end diff --git a/lib/puppet-lint/lexer/token.rb b/lib/puppet-lint/lexer/token.rb index e7076c39..af85cc5f 100644 --- a/lib/puppet-lint/lexer/token.rb +++ b/lib/puppet-lint/lexer/token.rb @@ -172,9 +172,9 @@ def find_token_of(direction, type, opts = {}) return nil unless [:next, :prev].include?(direction) opts[:skip_blocks] ||= true - to_find = Array[*type] + to_find = [*type] - token_iter = send("#{direction}_token".to_sym) + token_iter = send(:"#{direction}_token") until token_iter.nil? return token_iter if to_find.include?(token_iter.type) && (opts[:value].nil? || token_iter.value == opts[:value]) @@ -183,18 +183,18 @@ def find_token_of(direction, type, opts = {}) if opts[:skip_blocks] case token_iter.type - when "#{opening_token}BRACE".to_sym - token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}BRACE".to_sym, opts]) - when "#{opening_token}BRACK".to_sym - token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}BRACK".to_sym, opts]) - when "#{opening_token}PAREN".to_sym - token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}PAREN".to_sym, opts]) + when :"#{opening_token}BRACE" + token_iter = token_iter.send(:"#{direction}_token_of", [:"#{closing_token}BRACE", opts]) + when :"#{opening_token}BRACK" + token_iter = token_iter.send(:"#{direction}_token_of", [:"#{closing_token}BRACK", opts]) + when :"#{opening_token}PAREN" + token_iter = token_iter.send(:"#{direction}_token_of", [:"#{closing_token}PAREN", opts]) end end return nil if token_iter.nil? - token_iter = token_iter.send("#{direction}_token".to_sym) + token_iter = token_iter.send(:"#{direction}_token") end nil end diff --git a/lib/puppet-lint/tasks/puppet-lint.rb b/lib/puppet-lint/tasks/puppet-lint.rb index d1947af4..aec31455 100644 --- a/lib/puppet-lint/tasks/puppet-lint.rb +++ b/lib/puppet-lint/tasks/puppet-lint.rb @@ -65,7 +65,7 @@ def define(args, &task_block) ['with_filename', 'fail_on_warnings', 'error_level', 'log_format', 'with_context', 'fix', 'show_ignored', 'relative'].each do |config| value = instance_variable_get(:"@#{config}") - PuppetLint.configuration.send("#{config}=".to_sym, value) unless value.nil? + PuppetLint.configuration.send(:"#{config}=", value) unless value.nil? end @ignore_paths = PuppetLint.configuration.ignore_paths if PuppetLint.configuration.ignore_paths && @ignore_paths.empty? diff --git a/rubocop_baseline.yml b/rubocop_baseline.yml index f0f79135..4cf2aa0f 100644 --- a/rubocop_baseline.yml +++ b/rubocop_baseline.yml @@ -81,10 +81,3 @@ Style/Documentation: - spec/**/* Style/WordArray: EnforcedStyle: brackets -#################################################### -# Cops below here due for deprecation -#################################################### -# ``Rspec/FilePath`` is going to be deprecated in the next major release of rubocop >=3.0.0: see -# As the new cops are already present, e.g., Rspec/SpecFilePathPathFormat, then disabling this in preparation -RSpec/FilePath: - Enabled: false