'`%<statement>s` is used at the top level.' \ 'Use inside `class` or `module`.'.freeze RESTRICT_ON_SEND = %i[include extend prepend].freeze def_node_matcher :include_statement, <<~PATTERN (send nil? ${:include :extend :prepend} const) PATTERN def on_send(node) return unless (statement = include_statement(node)) return unless top_level_node?(node) add_offense(node, message: format(MSG, statement: statement)) end $PQ ϧʔϧ ͷ࣮ྫ