Sha256: ac9c0b1fafcb619c579de1cad9af119af483f88feb398f5ea5584696603a03d3

Contents?: true

Size: 543 Bytes

Versions: 19

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

module PlatformosCheck
  # 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:) do |corrector|
        # We need to fix #445 and pass the variables from the context or don't replace at all.
        # corrector.replace(node, "render \'#{node.value.template_name_expr}\' ")
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
platformos-check-0.4.8 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.7 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.6 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.5 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.4 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.3 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.2 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.1 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.4.0 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.3.3 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.3.1 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.3.0 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.2.2 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.2.1 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.2.0 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.1.0 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.0.3 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.0.2 lib/platformos_check/checks/convert_include_to_render.rb
platformos-check-0.0.1 lib/platformos_check/checks/convert_include_to_render.rb