lib/rubocop/cop/cop.rb in rubocop-1.66.1 vs lib/rubocop/cop/cop.rb in rubocop-1.67.0
- old
+ new
@@ -20,9 +20,17 @@
rescue StandardError => e
raise ErrorWithAnalyzedFileLocation.new(cause: e, node: node, cop: cop)
end
end
+ def self.inherited(_subclass)
+ super
+ warn Rainbow(<<~WARNING).yellow, uplevel: 1
+ Inheriting from `RuboCop::Cop::Cop` is deprecated. Use `RuboCop::Cop::Base` instead.
+ For more information, see https://docs.rubocop.org/rubocop/v1_upgrade_notes.html.
+ WARNING
+ end
+
def self.support_autocorrect?
method_defined?(:autocorrect)
end
def self.joining_forces