diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd382e5..05dfea9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,16 @@ jobs: ci: runs-on: ubuntu-latest name: RSpec and Rubocop + strategy: + matrix: + ruby: ['3.4', '4.0'] timeout-minutes: 3 steps: - uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.ruby_version }} + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run rspec run: bundle exec rspec diff --git a/.rubocop.yml b/.rubocop.yml index fdde201..2bc38f4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,5 @@ AllCops: - TargetRubyVersion: 3.2 + TargetRubyVersion: 4.0 NewCops: enable inherit_gem: diff --git a/.ruby-version b/.ruby-version index 2aa5131..43beb40 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.7 +4.0.7 diff --git a/Gemfile.lock b/Gemfile.lock index 7f54a1a..e7091ea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,36 +8,34 @@ PATH GEM remote: https://rubygems.org/ specs: - addressable (2.8.9) - public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) - bigdecimal (4.0.1) + bigdecimal (4.1.3) byebug (13.0.0) reline (>= 0.6.0) coderay (1.1.3) diff-lcs (1.6.2) - docile (1.4.1) - ffi (1.17.3-x86_64-linux-gnu) - foobara (0.5.9) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + foobara (0.6.3) bigdecimal foobara-lru-cache (< 2.0.0) foobara-util (< 2.0.0) inheritable-thread-vars (< 2.0.0) - foobara-files-generator (0.1.2) + foobara-files-generator (0.1.5) foobara (>= 0.1.1, < 2.0.0) foobara-lru-cache (1.0.0) - foobara-rubocop-rules (1.0.12) + foobara-rubocop-rules (1.1.1) rubocop rubocop-rspec - foobara-spec-helpers (0.1.0) + foobara-spec-helpers (0.1.1) foobara-util - foobara-typescript-remote-command-generator (1.4.0) + foobara-typescript-remote-command-generator (1.5.1) foobara (>= 0.1.16, < 2.0.0) foobara-files-generator (< 2.0.0) foobara-util (1.0.8) formatador (1.2.3) reline - guard (2.20.1) + guard (2.20.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) logger (~> 1.6) @@ -53,12 +51,9 @@ GEM guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) inheritable-thread-vars (0.0.3) - io-console (0.8.2) - json (2.19.2) - json-schema (6.2.0) - addressable (~> 2.8) - bigdecimal (>= 3.1, < 5) - language_server-protocol (3.17.0.5) + io-console (0.9.4) + json (3.0.2) + language_server-protocol (3.17.0.6) lint_roller (1.1.0) listen (3.10.0) logger @@ -66,15 +61,13 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) lumberjack (1.4.2) - mcp (0.8.0) - json-schema (>= 4.1) method_source (1.1.0) nenv (0.3.0) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - parallel (1.27.0) - parser (3.3.10.2) + parallel (2.2.0) + parser (3.3.12.0) ast (~> 2.4.1) racc prism (1.9.0) @@ -85,15 +78,14 @@ GEM pry-byebug (3.12.0) byebug (~> 13.0) pry (>= 0.13, < 0.17) - public_suffix (7.0.5) racc (1.8.1) rainbow (3.1.1) - rake (13.3.1) + rake (13.4.2) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - regexp_parser (2.11.3) - reline (0.6.3) + regexp_parser (2.12.0) + reline (0.7.0) io-console (~> 0.5) rspec (3.13.2) rspec-core (~> 3.13.0) @@ -111,41 +103,37 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.7) - rubocop (1.85.1) - json (~> 2.3) + rubocop (1.91.0) + json (>= 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) - mcp (~> 0.6) - parallel (~> 1.10) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.49.1) + rubocop-ast (1.50.0) parser (>= 3.3.7.2) prism (~> 1.7) rubocop-rake (0.7.1) lint_roller (~> 1.1) rubocop (>= 1.72.1) - rubocop-rspec (3.9.0) + rubocop-rspec (3.10.2) lint_roller (~> 1.1) - rubocop (~> 1.81) + regexp_parser (>= 2.0) + rubocop (~> 1.86, >= 1.86.2) ruby-progressbar (1.13.0) shellany (0.0.1) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.2) - simplecov_json_formatter (0.1.4) + simplecov (1.3.0) thor (1.5.0) - unicode-display_width (3.2.0) - unicode-emoji (~> 4.1) - unicode-emoji (4.2.0) + unicode-display_width (3.3.0) + unicode-emoji (~> 4.3) + unicode-emoji (4.3.0) PLATFORMS + arm64-darwin-25 x86_64-linux DEPENDENCIES @@ -163,7 +151,7 @@ DEPENDENCIES simplecov RUBY VERSION - ruby 3.4.1p0 + ruby 3.4.1p0 BUNDLED WITH - 2.4.14 + 4.0.21 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d393c34..c70ccb9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,6 +6,7 @@ require "pry-byebug" require "rspec/its" require "simplecov" +Warning[:deprecated] = true SimpleCov.start do # enable_coverage :branch diff --git a/src/typescript_react_command_form_generator.rb b/src/typescript_react_command_form_generator.rb index caec526..74ad45c 100644 --- a/src/typescript_react_command_form_generator.rb +++ b/src/typescript_react_command_form_generator.rb @@ -11,9 +11,9 @@ def manifest_to_generator_classes(manifest) Generators::TypescriptReactCommandFormGenerator ] else - # :nocov: + # simplecov:disable super - # :nocov: + # simplecov:enable end end end @@ -40,9 +40,9 @@ def type_generators(type_declaration = inputs_type, initial = true) # This simplifies things a bit re: form generation and setting UI # inputs into the inputs value. # TODO: test this path or delete it if unreachable! - # :nocov: + # simplecov:disable type_generators(type_declaration.to_type.primary_key_type, false) - # :nocov: + # simplecov:enable # generator_class = RemoteGenerator::Generators::UnloadedEntityGenerator # [generator_class.new(type_declaration.to_entity)] elsif type_declaration.model? @@ -113,9 +113,9 @@ def non_colliding_inputs(type_declaration = inputs_type, result = [], path = []) elsif type_declaration.detached_entity? # TODO: figure out how to not pass self here... # TODO: test this path or delete it if unreachable! - # :nocov: + # simplecov:disable result << FlattenedAttribute.new(self, path, type_declaration.to_type.primary_key_type) - # :nocov: + # simplecov:enable elsif type_declaration.model? non_colliding_inputs(type_declaration.to_type.attributes_type, result, path) elsif type_declaration.array? @@ -167,9 +167,9 @@ def _to_ts_string(result, depth: 0) elsif result.is_a?(::String) result else - # :nocov: + # simplecov:disable raise "Not sure how to handle #{result}" - # :nocov: + # simplecov:enable end end @@ -260,9 +260,9 @@ def html_input "parseInt(e.target.value)" elsif type.name.to_s == "float" || type.extends_symbol?(:float) # TODO: test this path - # :nocov: + # simplecov:disable "parseFloat(e.target.value)" - # :nocov: + # simplecov:enable else ts_type = generator.foobara_type_to_ts_type(type_declaration) "e.target.value as #{ts_type}"