theme-check 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/data/shopify_liquid/documentation/filters.json +32 -0
- data/data/shopify_liquid/documentation/latest.json +1 -1
- data/data/shopify_liquid/documentation/objects.json +11 -11
- data/docs/checks/app_block_valid_tags.md +1 -0
- data/lib/theme_check/checks/app_block_valid_tags.rb +4 -0
- data/lib/theme_check/tags.rb +19 -0
- 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: 6510c266c71be36555ad42b3de0dc88db11710ac631dd2d7292175764b3ce51f
|
4
|
+
data.tar.gz: d8eb627ff4f5de44cfea7a21049f37c42c007ff617fe2f07760ade8e1b0dc283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79f4683785b839a91731540fdf4b0e23d1d4f4a0a949aae3beb8637f651b8b0030ef5a3f9506da5de63109636410fc4cdb31616aade995442e61de43da4e2c55
|
7
|
+
data.tar.gz: 5dda4447bb00c1b4f225255c628d9f5ab6c5e17c619065681631d68953e3b0b4562a523a3c359a5e566007de0042282aec775f82dcecd05e2c4c5b4c8eee0003
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,36 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"category": "cart",
|
4
|
+
"deprecated": false,
|
5
|
+
"deprecation_reason": "",
|
6
|
+
"description": "",
|
7
|
+
"parameters": [
|
8
|
+
|
9
|
+
],
|
10
|
+
"return_type": [
|
11
|
+
{
|
12
|
+
"type": "number",
|
13
|
+
"name": "",
|
14
|
+
"description": "",
|
15
|
+
"array_value": ""
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"examples": [
|
19
|
+
{
|
20
|
+
"name": "",
|
21
|
+
"description": "",
|
22
|
+
"syntax": "",
|
23
|
+
"path": "/cart",
|
24
|
+
"raw_liquid": "{{ cart | item_count_for_variant: 39888235757633 }}",
|
25
|
+
"parameter": false,
|
26
|
+
"display_type": "text",
|
27
|
+
"show_data_tab": true
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"summary": "Returns the total item count of a variant in the cart.",
|
31
|
+
"syntax": "cart | item_count_for_variant: {variant_id}",
|
32
|
+
"name": "item_count_for_variant"
|
33
|
+
},
|
2
34
|
{
|
3
35
|
"category": "collection",
|
4
36
|
"deprecated": false,
|
@@ -1 +1 @@
|
|
1
|
-
{ "revision": "
|
1
|
+
{ "revision": "dc81fa4ea744b4fbd308801f059755084090fe42" }
|
@@ -568,7 +568,12 @@
|
|
568
568
|
"data_from_file": ""
|
569
569
|
},
|
570
570
|
"return_type": [
|
571
|
-
|
571
|
+
{
|
572
|
+
"type": "array",
|
573
|
+
"name": "",
|
574
|
+
"description": "",
|
575
|
+
"array_value": "collection"
|
576
|
+
}
|
572
577
|
]
|
573
578
|
},
|
574
579
|
{
|
@@ -12407,12 +12412,12 @@
|
|
12407
12412
|
}
|
12408
12413
|
],
|
12409
12414
|
"summary": "Returns `true` when being referenced inside a section that's been rendered using the Product Recommendations API and\nthe Section Rendering API. Returns `false` if not.",
|
12410
|
-
"name": "
|
12415
|
+
"name": "performed?"
|
12411
12416
|
},
|
12412
12417
|
{
|
12413
12418
|
"deprecated": false,
|
12414
12419
|
"deprecation_reason": "",
|
12415
|
-
"description": "If `
|
12420
|
+
"description": "If `performed?` is `false`, then an [EmptyDrop](/api/liquid/basics#emptydrop) is returned.",
|
12416
12421
|
"examples": [
|
12417
12422
|
|
12418
12423
|
],
|
@@ -12430,7 +12435,7 @@
|
|
12430
12435
|
{
|
12431
12436
|
"deprecated": false,
|
12432
12437
|
"deprecation_reason": "",
|
12433
|
-
"description": "If `
|
12438
|
+
"description": "If `performed?` is `false`, then 0 is returned.",
|
12434
12439
|
"examples": [
|
12435
12440
|
|
12436
12441
|
],
|
@@ -12448,7 +12453,7 @@
|
|
12448
12453
|
{
|
12449
12454
|
"deprecated": false,
|
12450
12455
|
"deprecation_reason": "",
|
12451
|
-
"description": "If `
|
12456
|
+
"description": "If `performed?` is `false`, then `nil` is returned.",
|
12452
12457
|
"examples": [
|
12453
12458
|
|
12454
12459
|
],
|
@@ -15075,12 +15080,7 @@
|
|
15075
15080
|
|
15076
15081
|
],
|
15077
15082
|
"return_type": [
|
15078
|
-
|
15079
|
-
"type": "metafield",
|
15080
|
-
"name": "",
|
15081
|
-
"description": "",
|
15082
|
-
"array_value": ""
|
15083
|
-
}
|
15083
|
+
|
15084
15084
|
],
|
15085
15085
|
"summary": "The [metafields](/api/liquid/objects/metafield) applied to the store.",
|
15086
15086
|
"name": "metafields"
|
@@ -11,6 +11,7 @@ This rule verifies none of the below tags are used in theme app extension blocks
|
|
11
11
|
- `{% include 'foo' %}`
|
12
12
|
- `{% layout 'foo' %}`
|
13
13
|
- `{% section 'foo' %}`
|
14
|
+
- `{% sections 'foo' %}`
|
14
15
|
|
15
16
|
:-1: **Incorrect** code for this check occurs with the use of any of the above tags in the liquid code of theme app extension blocks.
|
16
17
|
|
data/lib/theme_check/tags.rb
CHANGED
@@ -22,6 +22,24 @@ module ThemeCheck
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
class Sections < Liquid::Tag
|
26
|
+
SYNTAX = /\A\s*(?<sections_name>#{Liquid::QuotedString})\s*\z/o
|
27
|
+
|
28
|
+
attr_reader :sections_name
|
29
|
+
|
30
|
+
def initialize(tag_name, markup, options)
|
31
|
+
super
|
32
|
+
|
33
|
+
match = markup.match(SYNTAX)
|
34
|
+
raise(
|
35
|
+
Liquid::SyntaxError,
|
36
|
+
"Error in tag 'sections' - Valid syntax: sections '[type]'",
|
37
|
+
) unless match
|
38
|
+
@sections_name = match[:sections_name].tr(%('"), '')
|
39
|
+
@sections_name.chomp!(".liquid") if @sections_name.end_with?(".liquid")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
25
43
|
class Form < Liquid::Block
|
26
44
|
TAG_ATTRIBUTES = /([\w\-]+)\s*:\s*(#{Liquid::QuotedFragment})/o
|
27
45
|
# Matches forms with arguments:
|
@@ -204,6 +222,7 @@ module ThemeCheck
|
|
204
222
|
register_tag('render', Render)
|
205
223
|
register_tag('paginate', Paginate)
|
206
224
|
register_tag('section', Section)
|
225
|
+
register_tag('sections', Sections)
|
207
226
|
register_tag('style', Style)
|
208
227
|
register_tag('schema', Schema)
|
209
228
|
register_tag('javascript', Javascript)
|
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: 1.
|
4
|
+
version: 1.13.0
|
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:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|