Dylan Thacker-Smith and GitHub
2515f3be09
Use assert_template_result & assert_match_syntax_error in more places ( #1611 )
2022-09-01 17:40:39 -04:00
Dylan Thacker-Smith
0787660603
Reserve keyword arguments for new options in assert_template_result
2022-09-01 17:38:09 -04:00
Dylan Thacker-Smith
93c252fe5a
Stop passing unnecessary assigns to assert_match_syntax_error
2022-09-01 17:38:09 -04:00
Dylan Thacker-Smith
df13389940
Stop passing assigns as keyword arguments to assert_template_result
2022-09-01 17:38:08 -04:00
Dylan Thacker-Smith and GitHub
ca2d850eea
Stop using Liquid::Expression.parse for integration testing ( #1610 )
...
Since liquid-c no longer monkey patches it, so we need a higher-level
tests to ensure they are shared across liquid implementations.
2022-09-01 17:37:47 -04:00
Dylan Thacker-Smith and GitHub
eb89f22d93
Raise Liquid::SyntaxError instead of NoMethodError for invalid range ( #1607 )
2022-08-25 12:03:56 -04:00
Dylan Thacker-Smith
41c19929ad
Rename and alias Liquid::StaticRegisters to Liquid::Registers
2022-05-04 17:25:52 -04:00
Dylan Thacker-Smith
21f3337dec
Test a blank line in a comment tag
2022-04-28 09:38:44 -04:00
Charles-P. Clermont and Dylan Thacker-Smith
1f0a0ad55c
Add # inline comment tag.
...
This commit adds a new tag named `#` that behaves like a comment.
Therefore it behaves as you'd expect any tag would work. The difference
with the comment tag is that the comment is in the tag markup and that
there is no block delimiter.
What it looks like in practice:
```liquid
{%- # this is an inline comment -%}
{% # this too is an inline comment %}
{% liquid
# required args:
assign product = product
# optional args:
assign should_show_border = should_show_border | default: true
assign should_show_cursor = should_show_cursor | default: true
%}
{% liquid
# This is a very long comment that spans multiple lines.
# It looks very similar to what it would look like if you wrote
# ruby code instead of liquid. But it doesn't have all the clunk
# of having an open tag and a close tag with so many characters.
%}
```
Co-authored-by: Dylan Thacker-Smith <[email protected] >
2022-04-28 09:38:44 -04:00
Chris AtLee and Dylan Thacker-Smith
6c2c621712
Ensure that partial caches are shared with subcontexts
...
Make Context use StaticRegisters by default. This makes it easier to
ensure that all subcontexts share the same static registers.
Co-authored-by: Dylan Thacker-Smith <[email protected] >
2022-04-08 10:05:58 -04:00
Thierry Joyal and GitHub
7357dcf185
Merge pull request #1536 from Shopify/flaky-profiler-test-v2
...
Add artificial execution time in profiler tests
2022-03-07 10:06:13 -05:00
Thierry Joyal
4af38bc549
[StandardFilter] Fix missing @context on iterations
2022-03-07 09:17:07 -05:00
Thierry Joyal
df241abf70
Add artificial execution time in profiler tests
2022-03-07 08:50:03 -05:00
Thierry Joyal
0f5220c391
ContextTest: Classes to use appropriate ancestor
2022-03-04 09:14:57 -05:00
Thierry Joyal
7a23f46fab
ContextTest: Cleanup global variable assignments
2022-03-04 09:10:38 -05:00
Thierry Joyal
c0ffee16a3
StandardFiltersTest: Initialize following production code paths with context
2022-03-01 16:01:00 +00:00
0d83e64cfe
Add replace_last and remove_last filters ( #1422 )
...
Co-authored-by: ADTC <[email protected] >
Co-authored-by: Dylan Thacker-Smith <[email protected] >
2022-02-24 14:02:15 -05:00
Dylan Thacker-Smith and GitHub
0d5e01ae98
Fix some internal errors in filters from invalid input. ( #1476 )
...
These fixes came from improving the corresponding test, so these might not
actually be causing problems in practice.
2022-02-24 09:17:37 -05:00
Charles-P. Clermont
1310c4978d
Fix kwarg parsing inconsistency with Liquid::C
...
Liquid::C parses liquid filter arguments with dashes in them, Liquid does not.
For tags that accept kwargs and dumps them on the HTML tag, this is an important feature.
e.g. {{ ... | image_tag: loading: 'lazy', data-something: 'value!' }}
Without this change, Liquid would incorrectly parse the
`data-something` kwarg as a single argument and would skip over the
invalid characters.
See https://github.com/Shopify/theme-check/issues/539 for more context
2022-02-11 15:10:07 -05:00
Anders Søgaard and GitHub
db3999a008
Improve where filter tests ( #1472 )
2021-09-16 10:02:39 -04:00
Michael Go and GitHub
50d1a2ffc9
Merge pull request #1458 from Shopify/use-to-liquid-value-with-conditions
...
use Utils.to_liquid_value on conditionals
2021-06-15 12:18:14 -03:00
Michael Go
f686c5dec7
use Utils.to_liquid_value on conditionals
2021-06-14 18:19:37 -03:00
Michael Go and GitHub
aa8ce87b96
Merge pull request #1454 from Shopify/default-filter-with-to-liquid-value
...
utilize input's to_liquid_value on default filter
2021-06-14 15:43:56 -03:00
Michael Go
ac66dbbafe
utilize input's to_liquid_value on default filter
2021-06-08 15:20:53 -03:00
Daniel Insley and GitHub
017c1b5e83
Base64 Decode & Encode Filters ( #1450 )
2021-06-03 13:23:11 -04:00
Michael Go
e361a4d53c
introduce to_liquid_value on variable look and conditional statements
2021-05-26 17:27:18 -03:00
Dylan Thacker-Smith and GitHub
cfe1637bdd
Translate RangeError to Liquid::Error for truncatewords with large int ( #1431 )
2021-04-20 11:48:22 -04:00
Dylan Thacker-Smith and GitHub
ca96ca0fef
Fix support for using a String subclass for the liquid source ( #1421 )
2021-03-29 16:22:05 -04:00
Dylan Thacker-Smith and GitHub
4fba61a802
Merge pull request #1402 from Shopify/rubocop-shopify
...
Use the rubocop-shopify gem and autocorrect
2021-03-16 17:39:09 -04:00
Dylan Thacker-Smith
cd66572514
Rubocop autocorrections to prepare for rubocop config updates
2021-02-21 12:01:59 -05:00
Dylan Thacker-Smith and GitHub
dcb5a67089
performance: Use split limit in truncatewords ( #1361 )
2021-02-19 13:11:35 -05:00
Justin Li and GitHub
efe44a7e6a
Merge pull request #1391 from Unending/replace_carriage_return
...
handle carriage return in newlines_to_br
2021-02-19 12:49:13 -05:00
Dylan Thacker-Smith and GitHub
8625e66453
CI: Test with ruby 3.0 as the latest ruby version ( #1398 )
2021-02-10 10:10:27 -05:00
Unending
3cae09b968
handle carriage return in newlines_to_br
2021-01-16 18:49:01 +01:00
Dylan Thacker-Smith
f7d67b946e
rubocop autocorrect Style/MethodCallWithArgsParentheses
2020-12-11 13:51:00 -05:00
Dylan Thacker-Smith
da581d988a
Create top-level profile timing nodes for multiple template renders
2020-12-09 10:06:02 -05:00
Dylan Thacker-Smith
7960826552
Rename render_profiling_test.rb to profiler_test.rb
...
so it corresponds to the class name being tested
2020-12-09 10:06:02 -05:00
Dylan Thacker-Smith
b3f132efd1
Fix total_render_time if a Profiler gets used for multiple renders
2020-12-09 10:04:34 -05:00
Dylan Thacker-Smith
900e3a6491
Fix template name in profile result for render tag timing objects
2020-12-09 10:01:16 -05:00
Peter Zhu
bbfcaa2cc0
Revert "Merge pull request #1350 from Shopify/pz-instrument-invalid-end-tag"
...
This reverts commit e6eef4b2c4 , reversing
changes made to c7c21e88f0 .
2020-12-01 14:38:04 -05:00
Peter Zhu
ba657871bc
Revert "Merge pull request #1359 from Shopify/pz-instrument-range-floats"
...
This reverts commit 300adfd7ae , reversing
changes made to ed0aebcbc9 .
2020-12-01 14:37:23 -05:00
Peter Zhu
f357662f37
Instrument floats in ranges
2020-11-13 16:05:29 -05:00
Peter Zhu
ea4f1885f8
Instrument forloop.name
2020-11-12 14:19:12 -05:00
Peter Zhu
d844a3dd8b
Instrument usage of offset:continue in for loops
2020-11-12 13:39:02 -05:00
Peter Zhu and GitHub
0659891e68
Merge pull request #1352 from Shopify/pz-test-trim-blank
...
Test trim without any content
2020-11-10 10:36:21 -05:00
Peter Zhu
e7fb3b18f3
Test trim without any content
2020-11-10 10:31:07 -05:00
Peter Zhu
2ce577e36b
Instrument for bug #1346
2020-11-09 14:27:17 -05:00
Peter Zhu
a89371b0b9
Test space between dot
2020-11-05 15:39:44 -05:00
Dylan Thacker-Smith and GitHub
ea6e326b9c
Fix FrozenError for blank case tag with multiple expression when tag ( #1340 )
2020-10-28 13:37:17 -04:00
Dylan Thacker-Smith and GitHub
7754d5aef5
Attempt to strict parse variables before lax parsing in lax error mode ( #1338 )
2020-10-28 10:37:00 -04:00