theme-check 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/theme_check/checks/undefined_object.rb +5 -2
- data/lib/theme_check/checks/unused_assign.rb +4 -3
- data/lib/theme_check/offense.rb +3 -1
- data/lib/theme_check/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b17d14eb5abc8211b6b6ae9f3a676c44770775821a87ce0909412d3eddb81c35
|
4
|
+
data.tar.gz: 7bcad0d34832338dd8cd83f220b14c45b061b84b81c5ae2b3a18805aeb9400eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241dfdae6ec38c560ca4697c4b9256d4ceaed0300e9a575c3c92e864ea4fa2fd56420efd87ec2c0f744240fe9db5c6cc7df24c1da8d9606fab020bdd1d630450
|
7
|
+
data.tar.gz: bbb52dcf01cf1dcbc3f73fe90d822b9ee22407a31525aab314ad0121e1bd9f52c786b6528594e5eb6224d97e567108bd7962a8c7a67d6e17702a976bab3edb1a
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
|
2
|
+
v0.3.3 / 2021-02-18
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Fix column_end issues ([#164](https://github.com/Shopify/theme-check/issues/164))
|
6
|
+
* Fix stack overflow in UndefinedObject + UnusedAssign when snippets renders itself ([#165](https://github.com/Shopify/theme-check/issues/165))
|
7
|
+
|
2
8
|
v0.3.2 / 2021-02-17
|
3
9
|
==================
|
4
10
|
|
@@ -134,7 +134,7 @@ module ThemeCheck
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
-
def check_object(info, all_global_objects, render_node = nil)
|
137
|
+
def check_object(info, all_global_objects, render_node = nil, visited_snippets = Set.new)
|
138
138
|
check_undefined(info, all_global_objects, render_node)
|
139
139
|
|
140
140
|
info.each_snippet do |(snippet_name, node)|
|
@@ -143,7 +143,10 @@ module ThemeCheck
|
|
143
143
|
|
144
144
|
snippet_variables = node.value.attributes.keys +
|
145
145
|
Array[node.value.instance_variable_get("@alias_name")]
|
146
|
-
|
146
|
+
unless visited_snippets.include?(snippet_name)
|
147
|
+
visited_snippets << snippet_name
|
148
|
+
check_object(snippet_info, all_global_objects + snippet_variables, node, visited_snippets)
|
149
|
+
end
|
147
150
|
end
|
148
151
|
end
|
149
152
|
|
@@ -6,12 +6,13 @@ module ThemeCheck
|
|
6
6
|
category :liquid
|
7
7
|
|
8
8
|
class TemplateInfo < Struct.new(:used_assigns, :assign_nodes, :includes)
|
9
|
-
def collect_used_assigns(templates)
|
9
|
+
def collect_used_assigns(templates, visited = Set.new)
|
10
10
|
collected = used_assigns
|
11
11
|
# Check recursively inside included snippets for use
|
12
12
|
includes.each do |name|
|
13
|
-
if templates[name]
|
14
|
-
|
13
|
+
if templates[name] && !visited.include?(name)
|
14
|
+
visited << name
|
15
|
+
collected += templates[name].collect_used_assigns(templates, visited)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
collected
|
data/lib/theme_check/offense.rb
CHANGED
data/lib/theme_check/version.rb
CHANGED
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: 0.3.
|
4
|
+
version: 0.3.3
|
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: 2021-02-
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|