Closed gavindidrichsen closed 10 months ago
Fix rubocop string-to-symbol conversion nightly CI failures:
➜ rspec-puppet git:(maint_fix_rubocop_warnings) bundle exec rubocop --format github ::error file=lib/rspec-puppet/example/function_example_group.rb,line=103,col=61::Lint/SymbolConversion: Unnecessary symbol conversion; use `:"function_#{function_name}"` instead. ::error file=lib/rspec-puppet/matchers/create_generic.rb,line=306,col=18::Lint/SymbolConversion: Unnecessary symbol conversion; use `:"eachauto#{type}"` instead. ::error file=lib/rspec-puppet/matchers/type_matchers.rb,line=126,col=28::Lint/SymbolConversion: Unnecessary symbol conversion; use `:"valid#{attr_type}?"` instead. ::error file=spec/types/valid_provider_spec.rb,line=22,col=53::Lint/SymbolConversion: Unnecessary symbol conversion; use `:"with_#{k}"` instead. ::error file=spec/types/valid_provider_spec.rb,line=32,col=51::Lint/SymbolConversion: Unnecessary symbol conversion; use `:"with_#{k}"` instead. ➜ rspec-puppet git:(maint_fix_rubocop_warnings)
For example:
?➜ rspec-puppet git:(maint_fix_rubocop_warnings) git diff main..HEAD diff --git a/lib/rspec-puppet/example/function_example_group.rb b/lib/rspec-puppet/example/function_example_group.rb index df34fb0..6836129 100644 --- a/lib/rspec-puppet/example/function_example_group.rb +++ b/lib/rspec-puppet/example/function_example_group.rb @@ -100,7 +100,7 @@ module RSpec::Puppet return func if func.func if Puppet::Parser::Functions.function(function_name) - V3FunctionWrapper.new(function_name, scope.method("function_#{function_name}".intern)) + V3FunctionWrapper.new(function_name, scope.method(:"function_#{function_name}")) end end end
Summary
Fix rubocop string-to-symbol conversion nightly CI failures:
For example:
Checklist