Skip to content

Commit

Permalink
Merge pull request #288 from mvz/support-rubocop-1-38
Browse files Browse the repository at this point in the history
Support RuboCop 1.38
  • Loading branch information
etiennebarrie authored Nov 10, 2022
2 parents 0deeef2 + 9b7dec1 commit e152faf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.rubocop-next
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

eval_gemfile "../Gemfile"

gem "rubocop", "~> 1.37.1"
gem "rubocop", ">= 1.38.0"
8 changes: 7 additions & 1 deletion lib/erb_lint/linters/rubocop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,17 @@ def tempfile_from(filename, content)
end

def rubocop_processed_source(content, filename)
::RuboCop::ProcessedSource.new(
source = ::RuboCop::ProcessedSource.new(
content,
@rubocop_config.target_ruby_version,
filename
)
if ::RuboCop::Version::STRING.to_f >= 1.38
registry = RuboCop::Cop::Registry.global
source.registry = registry
source.config = @rubocop_config
end
source
end

def cop_classes
Expand Down

0 comments on commit e152faf

Please sign in to comment.