Dylan Thacker-Smith and GitHub
456be2f75e
Add a test and improve one for testing break ( #1616 )
2022-09-15 10:08:15 -04:00
Dylan Thacker-Smith and GitHub
ff1c35b986
Stop using assert_template_result in some tests depending on language extension ( #1622 )
2022-09-14 17:03:48 -04:00
Dylan Thacker-Smith and GitHub
cab08cfe57
Stop freezing the static environment hashes to allow Proc memoization ( #1623 )
2022-09-14 15:00:57 -04:00
Dylan Thacker-Smith and GitHub
bb7027138e
Merge pull request #1620 from Shopify/use-partials-test-option
...
Use assert_template_result partials option to specify file system state
2022-09-13 15:36:50 -04:00
Dylan Thacker-Smith
34512df8e9
Use assert_template_result partials option to specify file system state
2022-09-13 10:11:01 -04:00
Dylan Thacker-Smith
bca01e8944
Add assert_syntax_error convenience method
2022-09-13 10:11:01 -04:00
Dylan Thacker-Smith and GitHub
d3647e280d
Merge pull request #1615 from Shopify/render-expose-for-alias
...
Expose alias_name and for_loop? in render tag
2022-09-08 10:40:27 -04:00
Dylan Thacker-Smith and GitHub
8adbbfeaa6
Merge pull request #1614 from Shopify/extend-assert-tempate-result
...
Add partials, error_mode and render_errors options to assert_template_result
2022-09-07 13:17:08 -04:00
Dylan Thacker-Smith
4648f0fa64
Add sample usage of render_errors: true assert_template_result option
2022-09-06 16:54:38 -04:00
Dylan Thacker-Smith
3a64b3741f
Add sample usage of error_mode test helper option
2022-09-06 16:44:40 -04:00
Dylan Thacker-Smith
2c51a1922a
Add error_mode option to assert_match_syntax_error
2022-09-06 16:44:40 -04:00
Dylan Thacker-Smith
57fdc1b5fb
Add sample use of partials assert_template_result options
2022-09-06 16:44:39 -04:00
Dylan Thacker-Smith
308dfc3cb6
Add partials, error_mode and render_errors options to assert_template_result
2022-09-06 16:44:39 -04:00
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 and GitHub
433ed0fff2
Merge pull request #1612 from Shopify/assert-template-result-reserve-kwargs
...
Reserve keyword arguments for new options in assert_template_result
2022-09-01 17:39:28 -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
3a736da222
Add a variable_name method Increment and Decrement tags objects ( #1609 )
...
In order to expose this state when using the parse tree.
2022-08-31 09:18:33 -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 and GitHub
98e146ebf7
Merge pull request #1606 from Watson1978/performance-lexer-tokenize
...
Increase performance in Liquid::Lexer#tokenize
2022-08-24 15:03:41 -04:00
Dylan Thacker-Smith and GitHub
f1846d63a3
Merge pull request #1597 from Shopify/replace-cla-probot-with-action
...
Migrate off probot-CLA to new GitHub Action
2022-07-29 13:01:24 -04:00
Dylan Thacker-Smith and GitHub
86605016e1
Add Liquid::VariableLookup#lookup_command? to expose this parse node state ( #1583 )
2022-07-04 14:42:05 -04:00
Dylan Thacker-Smith and GitHub
eb70bb9b87
Refactor Liquid::Variable to respect disabling liquid-c nodes ( #1584 )
...
parse_context.parse_expression is overriden in liquid-c and will avoid
parsing to a Liquid::C::Expression when parsing with
`disable_liquid_c_nodes: true`
2022-06-21 15:19:56 -04:00
Dylan Thacker-Smith and GitHub
4d8e55dbc4
Merge pull request #1580 from Shopify/rubocop-autocorrect
...
Rubocop autocorrect Gemspec/DeprecatedAttributeAssignment offense
2022-06-06 11:53:06 -04:00
Dylan Thacker-Smith
f697093e94
Use stricter rubocop-shopify version constraint
...
to reduce CI failures being introduced without a code change.
2022-06-06 11:20:05 -04:00
Dylan Thacker-Smith
7594bed88a
Rubocop autocorrect Gemspec/DeprecatedAttributeAssignment offense
2022-06-06 11:09:47 -04:00
Dylan Thacker-Smith and GitHub
f64471eb4e
Merge pull request #1569 from Shopify/registers-refactor
...
Rename and alias Liquid::StaticRegisters to Liquid::Registers
2022-06-06 10:26:11 -04:00
Dylan Thacker-Smith
f77c766262
Rename Liquid::Registers @registers to @changes
...
since it doesn't represent all the registers
2022-05-04 17:25:53 -04:00
Dylan Thacker-Smith
7bc14ae2be
Remove unused class Liquid::Register to avoid confusion
2022-05-04 17:25:52 -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 and GitHub
05d768c6ab
Merge pull request #1498 from Shopify/feature/new-comment-syntax
...
Add `#` inline comment tag.
2022-04-28 09:46:59 -04:00
Dylan Thacker-Smith
54414dfd83
Add changelog entry, making the next release a feature release
2022-04-28 09:43:08 -04:00
Dylan Thacker-Smith
23a8438fa6
Use liquid-c master branch again, it now has inline comment support
2022-04-28 09:39:16 -04:00
Dylan Thacker-Smith
21f3337dec
Test a blank line in a comment tag
2022-04-28 09:38:44 -04:00
Dylan Thacker-Smith and GitHub
36dce29776
Avoid evaluating the template name in the render tag ( #1568 )
2022-04-21 16:10:42 -04:00
Dylan Thacker-Smith and GitHub
8b68630a11
Merge pull request #1474 from Shopify/clarify-warn-error-mode-doc
...
Clarify that the error_mode: :warn parse option is only for strict errors
2022-04-21 12:25:36 -04:00
Dylan Thacker-Smith and GitHub
1cae1e497f
Merge pull request #1560 from ghousemohamed/fix-typo
...
Fix typo: syntetic -> synthetic
2022-04-05 20:15:09 -04:00
Dylan Thacker-Smith and GitHub
ed7dae50aa
Merge pull request #1562 from ghousemohamed/bump-actions-checkout-to-v3
...
Bump actions/checkout to v3
2022-04-05 19:46:41 -04:00
Dylan Thacker-Smith and GitHub
6e07f73f68
History.md: Remove non-fix from fixes section of recent release. ( #1556 )
2022-03-23 11:59:50 -04:00
Dylan Thacker-Smith and GitHub
97f7922457
Add missing changelog entry for PR #1518 ( #1521 )
2022-02-24 14:46:26 -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
Dylan Thacker-Smith
0e14d539a3
README: Use newer hash syntax for the error_mode parse option
2021-09-16 10:16:36 -04:00
Dylan Thacker-Smith
db106ae058
Clarify that the error_mode: :warn parse option is only for strict errors
2021-09-16 10:13:57 -04:00
Dylan Thacker-Smith
b9e0d28729
rubocop: Clarify that a config is a rubocop-shopify backport
2021-04-20 09:01:06 -07:00
Dylan Thacker-Smith
020f6b93c5
rubocop: Fix unsupported ruby version in TargetRubyVersion error
2021-04-20 09:00:20 -07: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
eab13a07d9
Add changelog entry for a recent fix
2021-03-29 13:43:01 -07: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 and GitHub
6b6baece25
Merge pull request #1406 from ADTC/patch-2
...
Add a line to Sign the CLA as the first step in Workflow
2021-02-26 09:03:40 -05:00
Dylan Thacker-Smith
9dac68cce1
Use the rubocop-shopify gem
2021-02-21 12:22:03 -05:00
Dylan Thacker-Smith
c50509b741
Commit rubocop remote configuration update
2021-02-21 12:02:55 -05: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
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
Dylan Thacker-Smith and GitHub
260c863e23
Build the tokenizer through the parse context for liquid-c ( #1386 )
2021-01-07 14:51:41 -05:00
Dylan Thacker-Smith and GitHub
7ba0fc7952
Merge pull request #1376 from Shopify/support-app-liquid-context
...
Use the same context class for isolated subcontexts for the require tag
2020-12-14 12:12:46 -05:00
Dylan Thacker-Smith
40a9b72b3c
Allow a block to finish context init before squashing instance assigns
...
Liquid::Context#squash_instance_assigns_with_environments can result in
Proc objects in the environment to be eagerly evaluated. So it should be
possible to finish initializing the context object before this is done.
Allowing a block to be used for this purpose avoids the need to add
additional parameters for this purpose.
2020-12-11 14:52:09 -05:00
Dylan Thacker-Smith
4ff26cd707
Use the same context class for isolated subcontexts for the require tag
2020-12-11 14:52:09 -05:00
Dylan Thacker-Smith and GitHub
462919a28f
Merge pull request #1375 from Shopify/update-rubocop
...
Update rubocop and related configuration
2020-12-11 14:47:56 -05:00
Dylan Thacker-Smith
f3e2be9f85
Update rubocop
2020-12-11 14:14:15 -05:00
Dylan Thacker-Smith
4d40f83457
Update .rubocop_todo.yml to ignore Lint/MissingSuper offenses in drops
...
I don't think we can rely on the application to call `super` in their
drop's initializers at the moment, so doing that consistently in liquid
would prevent this from being properly tested.
2020-12-11 14:14:15 -05:00
Dylan Thacker-Smith
00be1e4dd4
Update inherited rubocop shopify style guide configuration
2020-12-11 14:14:15 -05:00
Dylan Thacker-Smith
f7d67b946e
rubocop autocorrect Style/MethodCallWithArgsParentheses
2020-12-11 13:51:00 -05:00
Dylan Thacker-Smith and GitHub
6dec172743
Merge pull request #1366 from Shopify/profile-render-node
...
Create top-level profile timing nodes for multiple template renders
2020-12-09 10:07:31 -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 and GitHub
84059691b8
Merge pull request #1365 from Shopify/profiling-multiple-renders
...
Support using a profiler for multiple renders
2020-12-09 10:05:48 -05:00
Dylan Thacker-Smith
896288eff1
Move start of profiling to a Document#render_to_output_buffer patch
2020-12-09 10:04:34 -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 and GitHub
60214b957c
Store the profiler in the context instead of a thread-local variable ( #1364 )
2020-12-09 10:04:20 -05:00
Dylan Thacker-Smith and GitHub
7361220af6
Merge pull request #1363 from Shopify/profiler-context-template-name
...
Fix template name in profile result for render tag timing objects
2020-12-09 10:03:42 -05:00
Dylan Thacker-Smith
cb2ad71a31
Remove the Profiler#initialize argument which is effectively now unused
...
The @root_timing Timing object that it was used with never exposed that
name.
2020-12-09 10:01:16 -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
Dylan Thacker-Smith and GitHub
f18084203d
Use monotonic time to measure durations in Liquid::Profiler ( #1362 )
2020-12-09 10:00:44 -05:00
Dylan Thacker-Smith and GitHub
1850511334
Use an atomic subgroup in range regex to avoid pathological backtracking ( #1360 )
2020-11-16 10:29:36 -05:00
Dylan Thacker-Smith and GitHub
8f7f8761d1
Use Array#each instead of Array#inject to avoid an object allocation ( #1341 )
2020-10-29 11:24:19 -04: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
Dylan Thacker-Smith and GitHub
1d63d5db5f
Fix a leaky test that set Tempate.error_mode without resetting it ( #1339 )
2020-10-28 10:36:33 -04:00
Dylan Thacker-Smith and GitHub
f23c2a83f2
Fix lax parsing expressions surrounded by spaces ( #1335 )
...
to make it compatible with strict parsing and liquid-c
2020-10-27 14:53:57 -04:00
Dylan Thacker-Smith and GitHub
10ea6144e0
Add Liquid::ParseContext#parse_expression for liquid-c node disabling ( #1333 )
...
We would like to be able to disable liquid-c VM rendering at runtime,
but right now expression parsing is done using Expression.parse, which
isn't aware of the parse context. That prevents us from conditionally
compiling to VM code based on a parse option.
2020-10-27 11:00:04 -04:00
Dylan Thacker-Smith and GitHub
4c6166f989
Add parsing quirk test for lookup on variable with literal name ( #1325 )
2020-10-21 16:30:17 -04:00
Dylan Thacker-Smith and GitHub
f6532de1fd
Merge pull request #1323 from Shopify/assign-score-hash
...
Avoid allocating arrays of key value pairs in assign_score_of
2020-10-21 11:18:35 -04:00
Dylan Thacker-Smith
001fde7694
Avoid allocating arrays of key value pairs for hashes in assign_score_of
2020-10-21 10:36:00 -04:00
Dylan Thacker-Smith
b872eac2b9
More comprehensively test assign_score_of
2020-10-21 10:35:56 -04:00
Dylan Thacker-Smith
038d0585cf
Move some assign score increment tests to the tag that increments
2020-10-21 10:21:00 -04:00
Dylan Thacker-Smith and GitHub
c9ad9d338c
Extract method for raising a syntax error in the assign tag for liquid-c ( #1321 )
2020-10-20 16:59:52 -04:00
Dylan Thacker-Smith and GitHub
ae6bd9f6b0
Allow an empty variable tag during strict parsing for liquid-c compat ( #1320 )
2020-10-20 14:11:48 -04:00
Dylan Thacker-Smith and GitHub
866e437c05
Test tag disabling using custom tags ( #1318 )
...
Since I don't think we have any use case to disable the `raw` or
`echo` tags, so I would like liquid-c to not have to support that
2020-10-19 16:32:02 -04:00
Dylan Thacker-Smith and GitHub
784db053f2
Merge pull request #1317 from Shopify/strict-parse-dynamic-find-var
...
Fix strict parsing of find variable with a name expression
2020-10-19 13:43:26 -04:00
Dylan Thacker-Smith and GitHub
ff1c6bd26e
Actually remove test file with no extension moved into another test file ( #1316 )
2020-10-19 12:40:02 -04:00
Dylan Thacker-Smith
46fd63da5f
Fix strict parsing of find variable with a name expression
2020-10-19 12:17:25 -04:00
Dylan Thacker-Smith
420a1c79e1
Refactor variable lookup strict parsing to reduce coupling on dot lookup
2020-10-19 12:10:32 -04:00
Dylan Thacker-Smith
6d39050e1e
Use a case statement in Liquid::Parser#expression
2020-10-19 12:10:11 -04:00
Dylan Thacker-Smith and GitHub
077bf2a409
Test reporting of liquid error for filter call with wrong number of arguments ( #1311 )
2020-10-08 11:55:40 -04:00
Dylan Thacker-Smith and GitHub
1a3e38c018
Merge pull request #1310 from Shopify/only-integration-test-liquid-c
...
Fix liquid-c integration testing
2020-10-08 11:52:50 -04:00
Dylan Thacker-Smith
e495f75cc2
Remove support for ruby 2.4, which is no longer supported upstream
2020-10-08 09:48:16 -04:00