diff --git a/.github/workflows/build-gems.yml b/.github/workflows/build-gems.yml index e134f1ef..f7fc4c24 100644 --- a/.github/workflows/build-gems.yml +++ b/.github/workflows/build-gems.yml @@ -74,7 +74,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - bundler-cache: false + bundler-cache: true - name: bundle install run: bundle install @@ -127,8 +127,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.4' - bundler-cache: false + bundler-cache: true - name: Download gem artifacts uses: actions/download-artifact@v4 diff --git a/.rubocop.yml b/.rubocop.yml index 62881c7c..7cb06055 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -133,15 +133,7 @@ Metrics/PerceivedComplexity: - bin/**/* Layout/LineLength: - Max: 120 - Exclude: - - test/**/*_test.rb - - lib/herb/token.rb - - lib/herb/ast/nodes.rb - - lib/herb/engine/error_formatter.rb - - lib/herb/engine/debug_visitor.rb - - lib/herb/engine/parser_error_overlay.rb - - lib/herb/engine/validation_error_overlay.rb + Enabled: false Layout/EmptyLines: Exclude: @@ -183,3 +175,6 @@ Lint/UnderscorePrefixedVariableName: Lint/UnusedMethodArgument: Exclude: - lib/herb/errors.rb + +Style/IfUnlessModifier: + Enabled: false diff --git a/.ruby-version b/.ruby-version index 7921bd0c..fcdb2e10 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.8 +4.0.0 diff --git a/Gemfile b/Gemfile index 2c505d9e..42a830aa 100644 --- a/Gemfile +++ b/Gemfile @@ -7,18 +7,23 @@ gemspec gem "prism", github: "ruby/prism", tag: "v1.7.0" gem "actionview", "~> 8.0" +gem "digest", "~> 3.2" gem "erubi" gem "lz_string" -gem "maxitest" +gem "maxitest", "~> 6.0" gem "minitest-difftastic", "~> 0.2" gem "rake", "~> 13.2" gem "rake-compiler", "~> 1.3" -gem "rake-compiler-dock", "1.11.0.rc1" +gem "rake-compiler-dock", "~> 1.11" +gem "rbs-inline", "~> 0.12" gem "reline", "~> 0.6" gem "rubocop", "~> 1.71" +gem "sorbet" +gem "steep", "~> 1.10" -group :development do - gem "rbs-inline", "~> 0.12" - gem "sorbet" - gem "steep", "~> 1.10" -end +# TODO: remove once it's fixed in RBS +# ❯ bundle exec rbs-inline --opt-out --output=sig/ lib/ +# /Users/marcoroth/Development/herb/vendor/bundle/ruby/4.0.0/gems/rbs-3.10.0/lib/rbs.rb:11: warning: tsort was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 4.1.0 +# You can add tsort to your Gemfile or gemspec to silence this warning. +# 🎉 Generated 0 RBS files under sig/ +gem "tsort", "~> 0.2.0" diff --git a/Gemfile.lock b/Gemfile.lock index 1ca494bb..2b69d912 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,18 +48,19 @@ GEM pretty_please difftastic (0.8.0-x86_64-linux) pretty_please + digest (3.2.1) dispersion (0.2.0) prism drb (2.2.3) erubi (1.13.1) - ffi (1.17.2-aarch64-linux-gnu) - ffi (1.17.2-aarch64-linux-musl) - ffi (1.17.2-arm64-darwin) - ffi (1.17.2-x86_64-darwin) - ffi (1.17.2-x86_64-linux-gnu) - ffi (1.17.2-x86_64-linux-musl) + ffi (1.17.3-aarch64-linux-gnu) + ffi (1.17.3-aarch64-linux-musl) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-darwin) + ffi (1.17.3-x86_64-linux-gnu) + ffi (1.17.3-x86_64-linux-musl) fileutils (1.8.0) - i18n (1.14.7) + i18n (1.14.8) concurrent-ruby (~> 1.0) io-console (0.8.2) json (2.18.0) @@ -73,23 +74,23 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) lz_string (0.3.0) - maxitest (6.1.0) + maxitest (6.2.0) minitest (>= 5.20.0, < 5.28.0) minitest (5.27.0) minitest-difftastic (0.2.1) difftastic (~> 0.6) mutex_m (0.3.0) - nokogiri (1.18.10-aarch64-linux-gnu) + nokogiri (1.19.0-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.10-aarch64-linux-musl) + nokogiri (1.19.0-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.10-arm64-darwin) + nokogiri (1.19.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.10-x86_64-darwin) + nokogiri (1.19.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.10-x86_64-linux-gnu) + nokogiri (1.19.0-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.10-x86_64-linux-musl) + nokogiri (1.19.0-x86_64-linux-musl) racc (~> 1.4) parallel (1.27.0) parser (3.3.10.0) @@ -109,11 +110,11 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rake-compiler-dock (1.11.0.rc1) + rake-compiler-dock (1.11.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbs (3.9.5) + rbs (3.10.0) logger rbs-inline (0.12.0) prism (>= 0.29) @@ -121,7 +122,7 @@ GEM regexp_parser (2.11.3) reline (0.6.3) io-console (~> 0.5) - rubocop (1.82.0) + rubocop (1.82.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -132,16 +133,16 @@ GEM rubocop-ast (>= 1.48.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.48.0) + rubocop-ast (1.49.0) parser (>= 3.3.7.2) - prism (~> 1.4) + prism (~> 1.7) ruby-progressbar (1.13.0) securerandom (0.4.1) - sorbet (0.6.12865) - sorbet-static (= 0.6.12865) - sorbet-static (0.6.12865-aarch64-linux) - sorbet-static (0.6.12865-universal-darwin) - sorbet-static (0.6.12865-x86_64-linux) + sorbet (0.6.12872) + sorbet-static (= 0.6.12872) + sorbet-static (0.6.12872-aarch64-linux) + sorbet-static (0.6.12872-universal-darwin) + sorbet-static (0.6.12872-x86_64-linux) steep (1.10.0) activesupport (>= 5.1) concurrent-ruby (>= 1.1.10) @@ -162,6 +163,7 @@ GEM strscan (3.1.6) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (3.2.0) @@ -182,20 +184,22 @@ PLATFORMS DEPENDENCIES actionview (~> 8.0) + digest (~> 3.2) erubi herb! lz_string - maxitest + maxitest (~> 6.0) minitest-difftastic (~> 0.2) prism! rake (~> 13.2) rake-compiler (~> 1.3) - rake-compiler-dock (= 1.11.0.rc1) + rake-compiler-dock (~> 1.11) rbs-inline (~> 0.12) reline (~> 0.6) rubocop (~> 1.71) sorbet steep (~> 1.10) + tsort (~> 0.2.0) BUNDLED WITH 2.7.2 diff --git a/ext/project.json b/ext/project.json index f5911754..f28b07b9 100644 --- a/ext/project.json +++ b/ext/project.json @@ -21,7 +21,7 @@ "test": { "executor": "nx:run-commands", "options": { - "command": "bundle exec mtest" + "command": "bundle exec rake test" }, "dependsOn": ["ruby-gem:build"] } diff --git a/test/snapshot_utils.rb b/test/snapshot_utils.rb index 396e8134..28aaf380 100644 --- a/test/snapshot_utils.rb +++ b/test/snapshot_utils.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "fileutils" -require "readline" +require "reline" require "digest" require_relative "../bin/lib/compare_helpers" @@ -155,7 +155,7 @@ def assert_snapshot_matches(actual, source, options = {}) Run the test using UPDATE_SNAPSHOTS=true to update (or create) the snapshot file for "#{class_name} #{name}" - UPDATE_SNAPSHOTS=true mtest #{e.location} + UPDATE_SNAPSHOTS=true bundle exec minitest #{e.location} #{divider} \e[0m