Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 3.2
TargetRubyVersion: 4.0
NewCops: enable

inherit_gem:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.7
4.0.7
74 changes: 31 additions & 43 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -53,28 +51,23 @@ 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
rb-fsevent (~> 0.10, >= 0.10.3)
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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -163,7 +151,7 @@ DEPENDENCIES
simplecov

RUBY VERSION
ruby 3.4.1p0
ruby 3.4.1p0

BUNDLED WITH
2.4.14
4.0.21
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require "pry-byebug"
require "rspec/its"
require "simplecov"
Warning[:deprecated] = true

SimpleCov.start do
# enable_coverage :branch
Expand Down
20 changes: 10 additions & 10 deletions src/typescript_react_command_form_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def manifest_to_generator_classes(manifest)
Generators::TypescriptReactCommandFormGenerator
]
else
# :nocov:
# simplecov:disable
super
# :nocov:
# simplecov:enable
end
end
end
Expand All @@ -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?
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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}"
Expand Down
Loading