Commit Graph
100 Commits
Author SHA1 Message Date
Dylan Thacker-SmithandGitHub e650dc4195 Revert "Instrument usage of bug with iteration of String with offset or 0 limit (#1667)" (#1677)
This reverts commit c743936a78.
2023-02-22 12:48:18 -05:00
Dylan Thacker-SmithandGitHub 59c445f0e1 Avoid a couple of duplicate assertions (#1675) 2023-02-02 09:31:01 -05:00
Dylan Thacker-SmithandGitHub e804f36681 Merge pull request #1674 from Shopify/better-test-to-liquid-value
Improve test coverage of the to_liquid_value feature.
2023-01-16 10:44:41 -05:00
Dylan Thacker-Smith 619ed3fcd7 Add some additional to_liquid_value assertions 2023-01-13 15:46:12 -05:00
Dylan Thacker-Smith cdb5cb06b2 Remove == method from drops from testing to_liquid_value
Since they could cause tests to pass without to_liquid_value being called
on the left side of the equality comparison.
2023-01-13 15:37:27 -05:00
Dylan Thacker-SmithandGitHub c743936a78 Instrument usage of bug with iteration of String with offset or 0 limit (#1667) 2023-01-11 14:05:50 -05:00
Dylan Thacker-SmithandGitHub bf711a0521 Provide another assertion for to_liquid_value unless tag test (#1672)
Since the original one would pass even if to_liquid_value isn't called on
the BooleanDrop object.
2023-01-11 14:05:27 -05:00
Dylan Thacker-SmithandGitHub e8731f27d9 Merge pull request #1671 from ashmaroli/use-builtin-bundle-cache
Use cache built into `ruby/setup-ruby` action
2023-01-11 11:40:11 -05:00
Dylan Thacker-SmithandGitHub c2c6cb2b15 Allow commas to separate for tag attributes (#1658)
For consistency with tags like the `render` tag, where we actually
prefer to use commas to separate attributes
2022-11-29 09:00:55 -05:00
Dylan Thacker-SmithandGitHub 1cdd1f0834 refactor: Advance tokenizer array offset instead of using Array#shift (#1653)
Array#shift would move all the remaining elements of the array, which
is slower for larger arrays.
2022-11-09 13:03:33 -05:00
Dylan Thacker-SmithandGitHub 1cd5ec54f0 Merge pull request #1641 from Shopify/assert-template-result-static-env
Use static environment assert_template_result input values
2022-11-02 10:05:52 -04:00
Dylan Thacker-SmithandGitHub ace3fe15ac Merge pull request #1648 from Shopify/fix-include-internal-error
Prevent an internal error in include tag from non-string template_name
2022-10-28 14:29:03 -04:00
Dylan Thacker-Smith db8e85ab31 Prevent an internal error in include tag from non-string template_name
which would otherwise happen on `template_name.split('/')`
2022-10-28 13:59:00 -04:00
Dylan Thacker-Smith f484b868d0 assert_template_result: Avoid using the BlankFileSystem
Since it doesn't reflect the real liquid usage that we are trying
to test against.
2022-10-28 13:55:33 -04:00
Dylan Thacker-SmithandGitHub 3e8994c258 Have subclasses of a tag inherit superclass's disabled tags (#1646) 2022-10-27 11:13:50 -04:00
Dylan Thacker-SmithandGitHub 96b5325f87 Remove Usage.increment calls that have been shown to in fact be used (#1645)
I think these were added for undocumented features to see if they were
actually used and they were being used.
2022-10-26 09:21:43 -04:00
Dylan Thacker-SmithandGitHub 6ce4ec1011 tablerow: Avoid accidental special case for constant nil cols (#1644)
It should behave the same as an expression that evaluates to nil
2022-10-25 10:21:03 -04:00
Dylan Thacker-Smith a39422feac Use static environment assert_template_result input values
To match how we use liquid in practice
2022-10-21 11:45:29 -04:00
Dylan Thacker-Smith 2c2f5826d5 Change increment/decrement tests to avoid relying on input
So these can be tested using language tests, without needing support
for counter value input, which isn't needed if input is provided
through the static environment.
2022-10-21 11:43:58 -04:00
Dylan Thacker-SmithandGitHub c99c93255d Merge pull request #1617 from Shopify/better-filter-overflow-handling
Support big integers in truncatewords and slice filters
2022-10-11 12:55:33 -04:00
Dylan Thacker-Smith c0c191cabd Add assertions for truncate filter with large integers 2022-10-11 12:44:33 -04:00
Dylan Thacker-Smith 6765d93938 Avoid internal errors for large arguments to slice filter
Use saturating conversion, which has expected semantics for large integers.
2022-10-11 12:44:32 -04:00
Dylan Thacker-Smith 4f17abfb4a Handle truncatewords word length out of range as if no truncation is needed 2022-10-11 12:44:32 -04:00
Dylan Thacker-SmithandGitHub 456be2f75e Add a test and improve one for testing break (#1616) 2022-09-15 10:08:15 -04:00
Dylan Thacker-SmithandGitHub ff1c35b986 Stop using assert_template_result in some tests depending on language extension (#1622) 2022-09-14 17:03:48 -04:00
Dylan Thacker-SmithandGitHub cab08cfe57 Stop freezing the static environment hashes to allow Proc memoization (#1623) 2022-09-14 15:00:57 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 2515f3be09 Use assert_template_result & assert_match_syntax_error in more places (#1611) 2022-09-01 17:40:39 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub eb89f22d93 Raise Liquid::SyntaxError instead of NoMethodError for invalid range (#1607) 2022-08-25 12:03:56 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 86605016e1 Add Liquid::VariableLookup#lookup_command? to expose this parse node state (#1583) 2022-07-04 14:42:05 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 36dce29776 Avoid evaluating the template name in the render tag (#1568) 2022-04-21 16:10:42 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 1cae1e497f Merge pull request #1560 from ghousemohamed/fix-typo
Fix typo: syntetic -> synthetic
2022-04-05 20:15:09 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 6e07f73f68 History.md: Remove non-fix from fixes section of recent release. (#1556) 2022-03-23 11:59:50 -04:00
Dylan Thacker-SmithandGitHub 97f7922457 Add missing changelog entry for PR #1518 (#1521) 2022-02-24 14:46:26 -05:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub ca96ca0fef Fix support for using a String subclass for the liquid source (#1421) 2021-03-29 16:22:05 -04:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub dcb5a67089 performance: Use split limit in truncatewords (#1361) 2021-02-19 13:11:35 -05:00
Dylan Thacker-SmithandGitHub 8625e66453 CI: Test with ruby 3.0 as the latest ruby version (#1398) 2021-02-10 10:10:27 -05:00
Dylan Thacker-SmithandGitHub 260c863e23 Build the tokenizer through the parse context for liquid-c (#1386) 2021-01-07 14:51:41 -05:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 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-SmithandGitHub 60214b957c Store the profiler in the context instead of a thread-local variable (#1364) 2020-12-09 10:04:20 -05:00
Dylan Thacker-SmithandGitHub 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-SmithandGitHub f18084203d Use monotonic time to measure durations in Liquid::Profiler (#1362) 2020-12-09 10:00:44 -05:00