diff --git a/.github/workflows/liquid.yml b/.github/workflows/liquid.yml index 8bda0aa1b..63d966621 100644 --- a/.github/workflows/liquid.yml +++ b/.github/workflows/liquid.yml @@ -22,6 +22,7 @@ jobs: with: ruby-version: ${{ matrix.entry.ruby }} bundler-cache: true + bundler: latest - run: bundle exec rake continue-on-error: ${{ matrix.entry.allowed-failure }} @@ -31,6 +32,5 @@ jobs: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 bundler-cache: true - run: bundle exec rake memory_profile:run diff --git a/.gitignore b/.gitignore index 90bf6dc1c..9029bf307 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,5 @@ pkg *.rbc .rvmrc -.ruby-version -Gemfile.lock .bundle .byebug_history diff --git a/.rubocop.yml b/.rubocop.yml index f917cc52d..8aebe5d81 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,7 +10,6 @@ Performance: Enabled: true AllCops: - TargetRubyVersion: 2.7 NewCops: disable SuggestExtensions: false Exclude: diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..15a279981 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.0 diff --git a/Gemfile b/Gemfile index b9b79f4f4..b5881c4a2 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ group :benchmark, :test do end group :test do - gem 'rubocop', '~> 1.44.0' + gem 'rubocop', '~> 1.61.0' gem 'rubocop-shopify', '~> 2.12.0', require: false gem 'rubocop-performance', require: false diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..66ff47345 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,73 @@ +GIT + remote: https://github.com/Shopify/liquid-c.git + revision: 5a786af7284df55e013ea20551c4b688d02e8326 + ref: main + specs: + liquid-c (4.2.0) + liquid (>= 5.0.1) + +PATH + remote: . + specs: + liquid (5.5.0) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + benchmark-ips (2.13.0) + json (2.7.2) + language_server-protocol (3.17.0.3) + memory_profiler (1.0.1) + minitest (5.22.3) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc + racc (1.7.3) + rainbow (3.1.1) + rake (13.2.1) + regexp_parser (2.9.0) + rexml (3.2.6) + rubocop (1.61.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-shopify (2.12.0) + rubocop (~> 1.44) + ruby-progressbar (1.13.0) + stackprof (0.2.26) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.5.0) + +PLATFORMS + ruby + +DEPENDENCIES + benchmark-ips + liquid! + liquid-c! + memory_profiler + minitest + rake (~> 13.0) + rubocop (~> 1.61.0) + rubocop-performance + rubocop-shopify (~> 2.12.0) + stackprof + terminal-table + +BUNDLED WITH + 2.5.7 diff --git a/lib/liquid/context.rb b/lib/liquid/context.rb index 80720a450..e712b4cc8 100644 --- a/lib/liquid/context.rb +++ b/lib/liquid/context.rb @@ -27,7 +27,7 @@ def initialize(environments = {}, outer_scope = {}, registers = {}, rethrow_erro @environments.flatten! @static_environments = [static_environments].flatten(1).freeze - @scopes = [(outer_scope || {})] + @scopes = [outer_scope || {}] @registers = registers.is_a?(Registers) ? registers : Registers.new(registers) @errors = [] @partial = false diff --git a/lib/liquid/tags/if.rb b/lib/liquid/tags/if.rb index a5cc84697..92ed8aa3b 100644 --- a/lib/liquid/tags/if.rb +++ b/lib/liquid/tags/if.rb @@ -111,7 +111,7 @@ def strict_parse(markup) def parse_binary_comparisons(p) condition = parse_comparison(p) first_condition = condition - while (op = (p.id?('and') || p.id?('or'))) + while (op = p.id?('and') || p.id?('or')) child_condition = parse_comparison(p) condition.send(op, child_condition) condition = child_condition