Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "(maint) Exclude breaking rubocop versions" #208

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions lib/puppet-lint/lexer/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet-lint/tasks/puppet-lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
7 changes: 0 additions & 7 deletions rubocop_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath>
# As the new cops are already present, e.g., Rspec/SpecFilePathPathFormat, then disabling this in preparation
RSpec/FilePath:
Enabled: false