Skip to content

Commit

Permalink
fix compatibility with RuboCop 1.38 after rubocop/rubocop#10987
Browse files Browse the repository at this point in the history
closes #76
  • Loading branch information
renatolond committed Nov 9, 2022
1 parent 18cd909 commit e374c32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/checks.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0']
rubocop: ['0.63.1', '0.81.0', '0.84.0', '0.85.0', '0.86.0', '0.87.0', '< 1.0', '1.0.0', '1.29.1', '1.30.0', '< 2.0']
rubocop: ['0.63.1', '0.81.0', '0.84.0', '0.85.0', '0.86.0', '0.87.0', '< 1.0', '1.0.0', '1.29.1', '1.30.0', '1.38.0', '< 2.0']
include:
- ruby: '2.3'
rubocop: '0.63.1'
Expand All @@ -26,10 +26,14 @@ jobs:
rubocop: '1.29.1'
- ruby: '2.4'
rubocop: '1.30.0'
- ruby: '2.4'
rubocop: '1.38.0'
- ruby: '2.5'
rubocop: '1.29.1'
- ruby: '2.5'
rubocop: '1.30.0'
- ruby: '2.5'
rubocop: '1.38.0'
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down
13 changes: 9 additions & 4 deletions lib/pronto/rubocop/patch_cop.rb
Expand Up @@ -22,10 +22,15 @@ def messages
end

def processed_source
@processed_source ||= ::RuboCop::ProcessedSource.from_file(
path,
rubocop_config.target_ruby_version
)
@processed_source ||= begin
processed_source = ::RuboCop::ProcessedSource.from_file(
path,
rubocop_config.target_ruby_version
)
processed_source.registry = registry if processed_source.respond_to?(:registry=)
processed_source.config = rubocop_config if processed_source.respond_to?(:config=)
processed_source
end
end

def registry
Expand Down

0 comments on commit e374c32

Please sign in to comment.