Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT REVIEW] [WIP] Add Sorbet proof-of-concept #11618

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 7 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ group :development do
gem 'irb'
gem 'letter_opener', '~> 1.8'
gem 'rack-mini-profiler', '>= 1.1.3', require: false
gem 'sorbet-static-and-runtime'
end

group :development, :test do
Expand All @@ -110,8 +111,8 @@ group :development, :test do
gem 'knapsack'
gem 'listen'
gem 'net-http-persistent', '~> 4.0.2', require: false
gem 'nokogiri', '~> 1.16.0'
gem 'pg_query', require: false
gem 'nokogiri', '~> 1.16.0', platforms: :ruby
gem 'pg_query', platforms: :ruby, require: false
gem 'pry-byebug'
gem 'pry-doc'
gem 'pry-rails'
Expand All @@ -122,7 +123,10 @@ group :development, :test do
gem 'rubocop-performance', '~> 1.23.0', require: false
gem 'rubocop-rails', '~> 2.27.0', require: false
gem 'rubocop-rspec', '~> 3.2.0', require: false
gem 'sqlite3', require: false
gem 'rubocop-sorbet', require: false
gem 'tapioca', require: false
gem 'spoom', require: false
gem 'sqlite3', platforms: :ruby, require: false
end

group :test do
Expand Down
46 changes: 46 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ GEM
net-smtp (0.5.0)
net-protocol
net-ssh (6.1.0)
netrc (0.11.0)
newrelic_rpm (9.7.0)
nio4r (2.7.3)
nokogiri (1.16.8)
Expand Down Expand Up @@ -477,6 +478,7 @@ GEM
actionmailer (>= 3)
net-smtp
premailer (~> 1.7, >= 1.7.9)
prism (1.2.0)
profanity_filter (0.1.1)
prometheus_exporter (2.1.0)
webrick
Expand Down Expand Up @@ -563,6 +565,9 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbi (0.2.1)
prism (~> 1.0)
sorbet-runtime (>= 0.5.9204)
rdoc (6.7.0)
psych (>= 4.0.0)
redacted_struct (2.0.0)
Expand Down Expand Up @@ -634,6 +639,8 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
rubocop-sorbet (0.8.7)
rubocop (>= 1)
ruby-progressbar (1.13.0)
ruby-saml (1.17.0)
nokogiri (>= 1.13.10)
Expand Down Expand Up @@ -675,13 +682,36 @@ GEM
simpleidn (0.2.1)
unf (~> 0.1.4)
smart_properties (1.17.0)
sorbet (0.5.11690)
sorbet-static (= 0.5.11690)
sorbet-runtime (0.5.11690)
sorbet-static (0.5.11690-aarch64-linux)
sorbet-static (0.5.11690-universal-darwin)
sorbet-static (0.5.11690-x86_64-linux)
sorbet-static-and-runtime (0.5.11690)
sorbet (= 0.5.11690)
sorbet-runtime (= 0.5.11690)
spoom (1.5.0)
erubi (>= 1.10.0)
prism (>= 0.28.0)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
sqlite3 (2.1.0)
mini_portile2 (~> 2.8.0)
stringex (2.8.5)
stringio (3.1.1)
strong_migrations (2.0.0)
activerecord (>= 6.1)
tableparser (1.0.1)
tapioca (0.16.5)
bundler (>= 2.2.25)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
rbi (~> 0.2)
sorbet-static-and-runtime (>= 0.5.11087)
spoom (>= 1.2.0)
thor (>= 1.2.0)
yard-sorbet
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.1)
Expand Down Expand Up @@ -740,13 +770,25 @@ GEM
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.37)
yard-sorbet (0.9.0)
sorbet-runtime
yard
zeitwerk (2.7.1)
zlib (3.0.0)
zonebie (0.6.1)
zxcvbn (0.1.12)

PLATFORMS
aarch64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm64-darwin
ruby
universal-darwin
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
ahoy_matey (~> 3.0)
Expand Down Expand Up @@ -848,6 +890,7 @@ DEPENDENCIES
rubocop-performance (~> 1.23.0)
rubocop-rails (~> 2.27.0)
rubocop-rspec (~> 3.2.0)
rubocop-sorbet
ruby-progressbar
ruby-saml
safe_target_blank (>= 1.0.2)
Expand All @@ -859,10 +902,13 @@ DEPENDENCIES
simplecov (~> 0.22.0)
simplecov-cobertura
simplecov_json_formatter
sorbet-static-and-runtime
spoom
sqlite3
stringex
strong_migrations (>= 0.4.2)
tableparser
tapioca
terminal-table
valid_email (>= 0.1.3)!
view_component (~> 3.0)
Expand Down
1 change: 0 additions & 1 deletion app/models/agreements/iaa_gtc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class Agreements::IaaGtc < ApplicationRecord
self.table_name = 'iaa_gtcs'

belongs_to :partner_account
belongs_to :iaa_status

has_many :iaa_orders, dependent: :restrict_with_exception
has_many :integrations, through: :iaa_orders
Expand Down
1 change: 0 additions & 1 deletion app/models/agreements/iaa_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class Agreements::IaaOrder < ApplicationRecord
self.table_name = 'iaa_orders'

belongs_to :iaa_gtc
belongs_to :iaa_status

has_one :partner_account, through: :iaa_gtc
has_many :integration_usages, dependent: :restrict_with_exception
Expand Down
27 changes: 27 additions & 0 deletions bin/spoom
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'spoom' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("spoom", "spoom")
27 changes: 27 additions & 0 deletions bin/srb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'srb' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("sorbet", "srb")
27 changes: 27 additions & 0 deletions bin/tapioca
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'tapioca' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("tapioca", "tapioca")
25 changes: 25 additions & 0 deletions sorbet/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--dir
.
--ignore=/bin/
--ignore=/lib/assets/
--ignore=/lib/cleanup/
--ignore=/lib/data_requests/
--ignore=/lib/deploy/
--ignore=/lib/linters/
--ignore=/lib/reporting/
--ignore=/lib/aamva_test
--ignore=/lib/action_account
--ignore=/lib/analytics_events_documenter
--ignore=/lib/data_pull
--ignore=/lib/env_irb_prompt
--ignore=/lib/extensions/capybara/node/simple
--ignore=/lib/makefile_help_parser
--ignore=/lib/pwned_password_downloader
--ignore=/lib/query_tracker
--ignore=/lib/script_base
--ignore=/scripts/
--ignore=/spec/
--ignore=tmp/
--ignore=vendor/
--enable-experimental-requires-ancestor
--suppress-payload-superclass-redefinition-for=Reline::ANSI
10 changes: 10 additions & 0 deletions sorbet/rbi/annotations/actionmailer.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading