Skip to content

Commit

Permalink
Support RuboCop v0.85.0 and later
Browse files Browse the repository at this point in the history
Use `Rubocop::Cop::Team#mobilize` instead of `Rubocop::Cop::Team.new`
if RuboCop version is 0.85.0 and later because RuboCop changed `Team` API
at v0.85.0.
ref. rubocop/rubocop#8030
  • Loading branch information
yujideveloper committed Jun 4, 2020
1 parent 0a2f99f commit b2402b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/pronto/rubocop/patch_cop.rb
Expand Up @@ -60,7 +60,13 @@ def offenses
end

def team
@team ||= ::RuboCop::Cop::Team.new(registry, rubocop_config)
@team ||=
if ::RuboCop::Cop::Team.respond_to?(:mobilize)
# rubocop v0.85.0 and later
::RuboCop::Cop::Team.mobilize(registry, rubocop_config)
else
::RuboCop::Cop::Team.new(registry, rubocop_config)
end
end
end
end
Expand Down

0 comments on commit b2402b1

Please sign in to comment.