Sha256: 06d1e1b856bc80d6bcb229a217fc543501b61a8c6a35afe4ee6c8db9a6967159

Contents?: true

Size: 645 Bytes

Versions: 30

Compression:

Stored size: 645 Bytes

Contents

# frozen_string_literal: true
module ThemeCheck
  class DeprecatedFilter < LiquidCheck
    doc docs_url(__FILE__)
    category :liquid
    severity :suggestion

    def on_variable(node)
      used_filters = node.value.filters.map { |name, *_rest| name }
      used_filters.each do |filter|
        alternatives = ShopifyLiquid::DeprecatedFilter.alternatives(filter)
        next unless alternatives

        alternatives = alternatives.map { |alt| "`#{alt}`" }
        add_offense(
          "Deprecated filter `#{filter}`, consider using an alternative: #{alternatives.join(', ')}",
          node: node,
        )
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
theme-check-1.8.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.7.2 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.7.1 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.7.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.6.2 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.6.1 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.6.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.5.2 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.5.1 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.5.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.4.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.3.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.2.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.1.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-1.0.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-0.10.2 lib/theme_check/checks/deprecated_filter.rb
theme-check-0.10.1 lib/theme_check/checks/deprecated_filter.rb
theme-check-0.10.0 lib/theme_check/checks/deprecated_filter.rb
theme-check-0.9.1 lib/theme_check/checks/deprecated_filter.rb
theme-check-0.9.0 lib/theme_check/checks/deprecated_filter.rb