Sha256: 18d7b0831c0644c2b113b1212bcf49b4ca023e504e3ef0d552758943a7c11a50
Contents?: true
Size: 638 Bytes
Versions: 35
Compression:
Stored size: 638 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Lint # @example # # bad # class Foo < Grape::API # # # good # class Foo < Api::AuthBase # # # good # class Foo < Api::Base class NoGrapeAPI < Cop MSG = 'Prefer inheriting `Api::AuthBase` or `Api::Base` instead of `Grape::API`.'.freeze def_node_matcher :inherits_Grape_API?, '(class (const ...) (const (const nil? :Grape) :API) ...)' def on_class(node) return unless inherits_Grape_API?(node) add_offense(node) end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems