Sha256: b944218403c86f7f08c0c1597048f3711106730c86e12240656b519f414b46a4
Contents?: true
Size: 863 Bytes
Versions: 65
Compression:
Stored size: 863 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module InternalAffairs # `RuboCop::Cop::Cop` is deprecated and will be removed in Rubocop 2.0. # Your custom cop class should inherit from `RuboCop::Cop::Base` instead of # `RuboCop::Cop::Cop`. # # See "v1 Upgrade Notes" for more details: # https://docs.rubocop.org/rubocop/v1_upgrade_notes.html # # @example # # bad # class Foo < Cop # end # # # good # class Foo < Base # end # class InheritDeprecatedCopClass < Base MSG = 'Use `Base` instead of `Cop`.' def on_class(node) return unless (parent_class = node.parent_class) return unless parent_class.children.last == :Cop add_offense(parent_class) end end end end end
Version data entries
65 entries across 59 versions & 7 rubygems