diff --git a/lib/rubocop/cop/base.rb b/lib/rubocop/cop/base.rb index 7953ec217ed..fbbec231bdf 100644 --- a/lib/rubocop/cop/base.rb +++ b/lib/rubocop/cop/base.rb @@ -230,6 +230,11 @@ def excluded_file?(file) !relevant_file?(file) end + # There should be very limited reasons for a Cop to do it's own parsing + def parse(source, path = nil) + ProcessedSource.new(source, target_ruby_version, path) + end + ### Persistence # Override if your cop should be called repeatedly for multiple investigations diff --git a/lib/rubocop/cop/cop.rb b/lib/rubocop/cop/cop.rb index 80af3dea948..9e6cbf7b02f 100644 --- a/lib/rubocop/cop/cop.rb +++ b/lib/rubocop/cop/cop.rb @@ -93,12 +93,6 @@ def self.qualified_cop_name(name, origin) Registry.qualified_cop_name(name, origin) end - # @deprecated - # Open issue if there's a valid use case to include this in Base - def parse(source, path = nil) - ProcessedSource.new(source, target_ruby_version, path) - end - private def begin_investigation(processed_source)