Sha256: 999f29f9c31458d0ece2b8d01ed218f48e64d2604d4a0f5e2f3d5a8f451f6e1a

Contents?: true

Size: 445 Bytes

Versions: 5

Compression:

Stored size: 445 Bytes

Contents

# frozen_string_literal: true
module ThemeCheck
  # Recommends replacing `include` for `render`
  class ConvertIncludeToRender < LiquidCheck
    severity :suggestion
    category :liquid
    doc docs_url(__FILE__)

    def on_include(node)
      add_offense("`include` is deprecated - convert it to `render`", node: node) do |corrector|
        corrector.replace(node, "render \'#{node.value.template_name_expr}\' ")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
theme-check-1.5.2 lib/theme_check/checks/convert_include_to_render.rb
theme-check-1.5.1 lib/theme_check/checks/convert_include_to_render.rb
theme-check-1.5.0 lib/theme_check/checks/convert_include_to_render.rb
theme-check-1.4.0 lib/theme_check/checks/convert_include_to_render.rb
theme-check-1.3.0 lib/theme_check/checks/convert_include_to_render.rb