theme-check 1.10.1 → 1.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 131d90a928b4130827c6e41ea99ccd852e650417e88baceb66910ff083cf3aaa
4
- data.tar.gz: a754d8b221da85eea053ce6f7547c9cad5a3a1e5f7a41562d61922a1278abe5d
3
+ metadata.gz: c21a0e8261a92b4eff6c415ca4205bb9e5f0b91c48cd9f2e4f6fb6a14adfe69c
4
+ data.tar.gz: 8dd16b772e87d56a174b9053c2fc4791457d79774b30e4b8813178224e8e7db2
5
5
  SHA512:
6
- metadata.gz: 8e2bc230eee811d2d0d8b62a09d11b3b88f2e54939f0c1aeda843d3f8d8455e34d0379aa89a9f388401d4ebb593a00abdfbb57357717fb9167bf7a73fb89943d
7
- data.tar.gz: f901b9cd064ee47fa39a6b661524e2d4eafc52b6cda54aceabd4ff371c1d562cfb43967c666642b1ef4d1c1b72cb793ab3cf202bfaee2a5f80aedb1840335155
6
+ metadata.gz: 03ac611f090d34741494bad1c9dd199ae90716c7bf10c2a99c0ae6e28aa5456d53c342ac3888bf683d4cfecb37605595586d720393f220f695379b6c1d5e3186
7
+ data.tar.gz: bc21703838ffa3606830505bfdc7d76b0fd675f402b7c062fe3ddd893ff62bb451fe57d44e77de8c6f99886546c0a261de9146d02833c81a10ec1c0c9e5ffc4e
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ v1.10.2 / 2022-03-07
3
+ ====================
4
+
5
+ * Handle nil paths in json_printer's sort_by ([#561](https://github.com/shopify/theme-check/issues/561))
6
+ * Prevent bad render tags from passing theme-check ([#559](https://github.com/shopify/theme-check/issues/559))
7
+
2
8
  v1.10.1 / 2022-02-24
3
9
  ====================
4
10
 
@@ -25,7 +25,7 @@ module ThemeCheck
25
25
  styleCount: path_offenses.count { |offense| offense[:severity] == Check::SEVERITY_VALUES[:style] },
26
26
  }
27
27
  end
28
- .sort_by { |o| o[:path] }
28
+ .sort_by { |o| o[:path] || Pathname.new('') }
29
29
  end
30
30
  end
31
31
  end
@@ -125,7 +125,23 @@ module ThemeCheck
125
125
  end
126
126
 
127
127
  class Render < Liquid::Tag
128
- SYNTAX = /((?:#{Liquid::QuotedString}|#{Liquid::VariableSegment})+)(\s+(with|#{Liquid::Render::FOR})\s+(#{Liquid::QuotedFragment}+))?(\s+(?:as)\s+(#{Liquid::VariableSegment}+))?/o
128
+ SYNTAX = %r{
129
+ (
130
+ ## for {% render "snippet" %}
131
+ #{Liquid::QuotedString}+ |
132
+ ## for {% render block %}
133
+ ## We require the variable # segment to be at the beginning of the
134
+ ## string (with \A). This is to prevent code like {% render !foo! %}
135
+ ## from parsing
136
+ \A#{Liquid::VariableSegment}+
137
+ )
138
+ ## for {% render "snippet" with product as p %}
139
+ ## or {% render "snippet" for products p %}
140
+ (\s+(with|#{Liquid::Render::FOR})\s+(#{Liquid::QuotedFragment}+))?
141
+ (\s+(?:as)\s+(#{Liquid::VariableSegment}+))?
142
+ ## variables passed into the tag (e.g. {% render "snippet", var1: value1, var2: value2 %}
143
+ ## are not matched by this regex and are handled by Liquid::Render.initialize
144
+ }xo
129
145
 
130
146
  disable_tags "include"
131
147
 
@@ -134,7 +150,7 @@ module ThemeCheck
134
150
  def initialize(tag_name, markup, options)
135
151
  super
136
152
 
137
- raise SyntaxError, options[:locale].t("errors.syntax.render") unless markup =~ SYNTAX
153
+ raise Liquid::SyntaxError, options[:locale].t("errors.syntax.render") unless markup =~ SYNTAX
138
154
 
139
155
  template_name = Regexp.last_match(1)
140
156
  with_or_for = Regexp.last_match(3)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ThemeCheck
3
- VERSION = "1.10.1"
3
+ VERSION = "1.10.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theme-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Cournoyer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-24 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid