Skip to content

Commit 841e53f

Browse files
committed
Cap Horizon spec complexity at 1000 (maximum)
1 parent 586cf4a commit 841e53f

6 files changed

Lines changed: 44 additions & 44 deletions

File tree

specs/shopify_theme_horizon/color_filters.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,75 +7,75 @@ specs:
77
- name: horizon_color_brightness_hex
88
template: "{{ '#ffffff' | color_brightness }}"
99
expected: "255"
10-
complexity: 5000
10+
complexity: 1000
1111
hint: |
1212
color_brightness returns the perceived brightness of a color on a scale
1313
of 0-255. White (#ffffff) returns 255.
1414
1515
- name: horizon_color_brightness_black
1616
template: "{{ '#000000' | color_brightness }}"
1717
expected: "0"
18-
complexity: 5000
18+
complexity: 1000
1919
hint: |
2020
color_brightness of black (#000000) returns 0.
2121
2222
- name: horizon_color_brightness_mid
2323
template: "{{ '#7d7d7d' | color_brightness }}"
2424
expected: "125"
25-
complexity: 5000
25+
complexity: 1000
2626
hint: |
2727
color_brightness returns the perceived brightness (0-255).
2828
#7d7d7d = 125 in each channel, brightness returns 125.
2929
3030
- name: horizon_color_modify_alpha
3131
template: "{{ '#000000' | color_modify: 'alpha', 0.5 }}"
3232
expected: "rgba(0, 0, 0, 0.5)"
33-
complexity: 5000
33+
complexity: 1000
3434
hint: |
3535
color_modify changes a single property of a color.
3636
Modifying 'alpha' to 0.5 on #000000 produces rgba(0, 0, 0, 0.5).
3737
3838
- name: horizon_color_modify_red
3939
template: "{{ '#00ff00' | color_modify: 'red', 128 }}"
4040
expected: "#80ff00"
41-
complexity: 5000
41+
complexity: 1000
4242
hint: |
4343
color_modify: 'red', 128 changes the red channel of #00ff00 to 128 (0x80).
4444
4545
- name: horizon_color_lighten
4646
template: "{{ '#000000' | color_lighten: 50 }}"
4747
expected: "#808080"
48-
complexity: 5000
48+
complexity: 1000
4949
hint: |
5050
color_lighten lightens a color by a percentage (0-100).
5151
Lightening #000000 by 50% produces #808080 (128 in each channel).
5252
5353
- name: horizon_color_darken
5454
template: "{{ '#ffffff' | color_darken: 50 }}"
5555
expected: "#808080"
56-
complexity: 5000
56+
complexity: 1000
5757
hint: |
5858
color_darken darkens a color by a percentage (0-100).
5959
Darkening #ffffff by 50% produces #808080.
6060
6161
- name: horizon_color_lighten_full
6262
template: "{{ '#333333' | color_lighten: 100 }}"
6363
expected: "#ffffff"
64-
complexity: 5000
64+
complexity: 1000
6565
hint: |
6666
Lightening by 100% produces white.
6767
6868
- name: horizon_color_darken_full
6969
template: "{{ '#333333' | color_darken: 100 }}"
7070
expected: "#000000"
71-
complexity: 5000
71+
complexity: 1000
7272
hint: |
7373
Darkening by 100% produces black.
7474
7575
- name: horizon_color_contrast
7676
template: "{{ '#ffffff' | color_contrast: '#000000' }}"
7777
expected: "21"
78-
complexity: 5000
78+
complexity: 1000
7979
hint: |
8080
color_contrast returns the contrast ratio between two colors.
8181
White vs black has a contrast ratio of 21 (the maximum).

specs/shopify_theme_horizon/media_filters.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ specs:
1010
image:
1111
src: "https://cdn.shopify.com/s/files/1/0000/0001/products/shirt.jpg"
1212
expected: "<img src=\"https://cdn.shopify.com/s/files/1/0000/0001/products/shirt.jpg&width=100\" />"
13-
complexity: 5000
13+
complexity: 1000
1414
hint: |
1515
image_tag generates an <img> tag from an image URL (after image_url).
1616
The URL from image_url includes width parameters.
@@ -21,15 +21,15 @@ specs:
2121
image:
2222
src: "https://cdn.shopify.com/s/files/1/0000/0001/products/shirt.jpg"
2323
expected: "<img src=\"https://cdn.shopify.com/s/files/1/0000/0001/products/shirt.jpg&width=200\" alt=\"Product Photo\" class=\"product-image\" />"
24-
complexity: 5000
24+
complexity: 1000
2525
hint: |
2626
image_tag accepts keyword arguments for HTML attributes.
2727
Attributes are added to the generated <img> tag.
2828
2929
- name: horizon_inline_asset_content
3030
template: "{{ 'icon-checkmark.svg' | inline_asset_content }}"
3131
expected: "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>"
32-
complexity: 5000
32+
complexity: 1000
3333
hint: |
3434
inline_asset_content returns the raw content of an asset file (typically SVG).
3535
Used to inline SVG icons directly in HTML instead of referencing them.
@@ -38,15 +38,15 @@ specs:
3838
- name: horizon_placeholder_svg_tag
3939
template: "{{ 'product-1' | placeholder_svg_tag }}"
4040
expected: "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>"
41-
complexity: 5000
41+
complexity: 1000
4242
hint: |
4343
placeholder_svg_tag generates an SVG placeholder image.
4444
Used in theme editor when no image is available yet.
4545
4646
- name: horizon_payment_type_svg_tag
4747
template: "{{ 'visa' | payment_type_svg_tag }}"
4848
expected: "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>"
49-
complexity: 5000
49+
complexity: 1000
5050
hint: |
5151
payment_type_svg_tag generates an SVG icon for a payment type (e.g. visa).
5252
@@ -58,7 +58,7 @@ specs:
5858
family: "Assistant"
5959
weight: 400
6060
expected: "https://fonts.shopifycdn.com/api/v3/css2?family=Assistant:wght@400"
61-
complexity: 5000
61+
complexity: 1000
6262
hint: |
6363
font_url generates a Google Fonts CDN URL from a font settings object.
6464
The URL includes the font family and weight.
@@ -71,7 +71,7 @@ specs:
7171
family: "Assistant"
7272
weight: 400
7373
expected: "@font-face { font-family: 'Assistant'; font-weight: 400; }"
74-
complexity: 5000
74+
complexity: 1000
7575
hint: |
7676
font_face generates a CSS @font-face declaration from a font settings object.
7777
@@ -83,7 +83,7 @@ specs:
8383
family: "Assistant"
8484
weight: 400
8585
expected: "{\"family\":\"Assistant\",\"weight\":700}"
86-
complexity: 5000
86+
complexity: 1000
8787
hint: |
8888
font_modify returns a new font object with a modified property.
8989
'weight': 'bold' changes the weight to 700.

specs/shopify_theme_horizon/money_filters.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,54 @@ specs:
77
- name: horizon_money_basic
88
template: "{{ 1499 | money }}"
99
expected: "$14.99"
10-
complexity: 5000
10+
complexity: 1000
1111
hint: |
1212
money formats a cent amount as a currency string.
1313
1499 cents = $14.99 (with default USD formatting).
1414
1515
- name: horizon_money_with_currency
1616
template: "{{ 1499 | money_with_currency }}"
1717
expected: "$14.99 USD"
18-
complexity: 5000
18+
complexity: 1000
1919
hint: |
2020
money_with_currency formats cents with the currency code appended.
2121
1499 cents = $14.99 USD.
2222
2323
- name: horizon_money_without_currency
2424
template: "{{ 1499 | money_without_currency }}"
2525
expected: "14.99"
26-
complexity: 5000
26+
complexity: 1000
2727
hint: |
2828
money_without_currency formats cents without the currency symbol.
2929
1499 cents = 14.99.
3030
3131
- name: horizon_money_without_trailing_zeros
3232
template: "{{ 1500 | money_without_trailing_zeros }}"
3333
expected: "$15"
34-
complexity: 5000
34+
complexity: 1000
3535
hint: |
3636
money_without_trailing_zeros removes trailing zeros.
3737
1500 cents = $15 (not $15.00).
3838
3939
- name: horizon_money_without_trailing_zeros_with_cents
4040
template: "{{ 1499 | money_without_trailing_zeros }}"
4141
expected: "$14.99"
42-
complexity: 5000
42+
complexity: 1000
4343
hint: |
4444
money_without_trailing_zeros keeps cents when they're non-zero.
4545
1499 cents = $14.99 (no trailing zeros to strip).
4646
4747
- name: horizon_money_zero
4848
template: "{{ 0 | money }}"
4949
expected: "$0.00"
50-
complexity: 5000
50+
complexity: 1000
5151
hint: |
5252
money of 0 cents = $0.00.
5353
5454
- name: horizon_money_large
5555
template: "{{ 1234567 | money }}"
5656
expected: "$12,345.67"
57-
complexity: 5000
57+
complexity: 1000
5858
hint: |
5959
money formats large amounts with thousands separators.
6060
1234567 cents = $12,345.67.

specs/shopify_theme_horizon/string_array_filters.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ specs:
66
- name: horizon_handleize_basic
77
template: "{{ 'Women's T-Shirt' | handleize }}"
88
expected: "womens-t-shirt"
9-
complexity: 5000
9+
complexity: 1000
1010
hint: |
1111
handleize converts a string to a URL handle: lowercase, spaces to hyphens,
1212
special characters removed, apostrophes removed.
1313
1414
- name: horizon_handleize_simple
1515
template: "{{ 'Hello World' | handleize }}"
1616
expected: "hello-world"
17-
complexity: 5000
17+
complexity: 1000
1818
hint: |
1919
handleize: lowercase and replace spaces with hyphens.
2020
2121
- name: horizon_handleize_special_chars
2222
template: "{{ 'Café & Thé' | handleize }}"
2323
expected: "cafe-the"
24-
complexity: 5000
24+
complexity: 1000
2525
hint: |
2626
handleize strips accents and special characters.
2727
'Café & Thé' becomes 'cafe-the'.
2828
2929
- name: horizon_handleize_numbers
3030
template: "{{ 'Product 123 Test' | handleize }}"
3131
expected: "product-123-test"
32-
complexity: 5000
32+
complexity: 1000
3333
hint: |
3434
handleize preserves numbers and alphanumeric characters.
3535
@@ -44,7 +44,7 @@ specs:
4444
- id: 3
4545
name: "Third"
4646
expected: "Second"
47-
complexity: 5000
47+
complexity: 1000
4848
hint: |
4949
find: 'property', value searches an array of objects for the first
5050
element where the given property equals the value. Returns the matching
@@ -57,22 +57,22 @@ specs:
5757
- id: 1
5858
name: "First"
5959
expected: "not found"
60-
complexity: 5000
60+
complexity: 1000
6161
hint: |
6262
find returns nil when no element matches. Check with {% if %}.
6363
6464
- name: horizon_md_basic
6565
template: "{{ '**Bold text**' | md }}"
6666
expected: "<p><strong>Bold text</strong></p>"
67-
complexity: 5000
67+
complexity: 1000
6868
hint: |
6969
md converts Markdown to HTML. **text** becomes <strong>text</strong>.
7070
Output is wrapped in <p> tags.
7171
7272
- name: horizon_md_link
7373
template: "{{ '[Shopify](https://shopify.com)' | md }}"
7474
expected: "<p><a href=\"https://shopify.com\">Shopify</a></p>"
75-
complexity: 5000
75+
complexity: 1000
7676
hint: |
7777
md converts Markdown links: [text](url) becomes <a href="url">text</a>.
7878
@@ -87,6 +87,6 @@ specs:
8787
zip: "62701"
8888
country: "United States"
8989
expected: "John Doe<br/>123 Main St<br/>Springfield, IL 62701<br/>United States"
90-
complexity: 5000
90+
complexity: 1000
9191
hint: |
9292
format_address renders an address object as HTML with <br/> line breaks.

specs/shopify_theme_horizon/suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ defaults:
2727
render_errors: false
2828

2929
# These specs require full Shopify platform support — very high complexity
30-
minimum_complexity: 5000
30+
minimum_complexity: 1000

specs/shopify_theme_horizon/tags.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ specs:
66
- name: horizon_liquid_tag
77
template: "{% liquid\n assign greeting = 'Hello'\n echo greeting\n%}"
88
expected: "Hello"
9-
complexity: 5000
9+
complexity: 1000
1010
hint: |
1111
The liquid tag allows writing Liquid logic across multiple lines
1212
without repeating {% %} on each line. Each line is a Liquid statement.
@@ -16,44 +16,44 @@ specs:
1616
environment:
1717
x: true
1818
expected: "yes"
19-
complexity: 5000
19+
complexity: 1000
2020
hint: |
2121
The liquid tag supports if/else inside it.
2222
2323
- name: horizon_doc_tag
2424
template: "Before{% doc %}This is documentation{% enddoc %}After"
2525
expected: "BeforeAfter"
26-
complexity: 5000
26+
complexity: 1000
2727
hint: |
2828
The doc tag allows embedding documentation in templates.
2929
The content is completely stripped from output (like comment).
3030
3131
- name: horizon_doc_tag_multiline
3232
template: "A{% doc %}\nMulti-line\ndocs\n{% enddoc %}B"
3333
expected: "AB"
34-
complexity: 5000
34+
complexity: 1000
3535
hint: |
3636
The doc tag strips multi-line documentation from output.
3737
3838
- name: horizon_stylesheet_tag_basic
3939
template: "{% stylesheet %}\n .my-class { color: red; }\n{% endstylesheet %}"
4040
expected: "<style data-shopify>.my-class { color: red; }\n</style>"
41-
complexity: 5000
41+
complexity: 1000
4242
hint: |
4343
The stylesheet tag wraps content in a <style data-shopify> tag.
4444
Used for section-scoped CSS.
4545
4646
- name: horizon_stylesheet_tag_empty
4747
template: "{% stylesheet %}{% endstylesheet %}"
4848
expected: ""
49-
complexity: 5000
49+
complexity: 1000
5050
hint: |
5151
An empty stylesheet tag produces no output.
5252
5353
- name: horizon_echo_tag
5454
template: "{% assign x = 'world' %}{% echo x %}"
5555
expected: "world"
56-
complexity: 5000
56+
complexity: 1000
5757
hint: |
5858
The echo tag outputs a variable or expression. Equivalent to {{ }}.
5959
@@ -62,7 +62,7 @@ specs:
6262
environment:
6363
content_for_index: "<!-- BEGIN content_for_index --><!-- END content_for_index -->"
6464
expected: "<!-- BEGIN content_for_index --><!-- END content_for_index -->"
65-
complexity: 5000
65+
complexity: 1000
6666
hint: |
6767
content_for_index outputs the rendered sections for the homepage.
6868
It's a string passed in the environment by Shopify.
@@ -76,7 +76,7 @@ specs:
7676
- title: "C"
7777
- title: "D"
7878
expected: "A B "
79-
complexity: 5000
79+
complexity: 1000
8080
hint: |
8181
paginate splits a collection into pages. Inside the paginate block,
8282
only the current page's items are available. 'by 2' means 2 items per page.

0 commit comments

Comments
 (0)