Sha256: 4024506ea0a20f6777577d2f30fdc15fc3c84924954c197ab152735565154203

Contents?: true

Size: 915 Bytes

Versions: 22

Compression:

Stored size: 915 Bytes

Contents

# frozen_string_literal: true
module ThemeCheck
  # Reports errors when invalid tags are used in a Theme App
  # Extension block
  class AppBlockValidTags < LiquidCheck
    severity :error
    category :liquid
    doc docs_url(__FILE__)

    # Don't allow this check to be disabled with a comment,
    # since we need to be able to enforce this server-side
    can_disable false

    OFFENSE_MSG = "Theme app extension blocks cannot contain %s tags"

    def on_javascript(node)
      add_offense(OFFENSE_MSG % 'javascript', node: node)
    end

    def on_stylesheet(node)
      add_offense(OFFENSE_MSG % 'stylesheet', node: node)
    end

    def on_include(node)
      add_offense(OFFENSE_MSG % 'include', node: node)
    end

    def on_layout(node)
      add_offense(OFFENSE_MSG % 'layout', node: node)
    end

    def on_section(node)
      add_offense(OFFENSE_MSG % 'section', node: node)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
theme-check-1.12.1 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.12.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.11.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.10.3 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.10.2 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.10.1 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.10.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.9.2 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.9.1 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.9.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.8.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.7.2 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.7.1 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.7.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.6.2 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.6.1 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.6.0 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.5.2 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.5.1 lib/theme_check/checks/app_block_valid_tags.rb
theme-check-1.5.0 lib/theme_check/checks/app_block_valid_tags.rb