Skip to content

Commit 18910a1

Browse files
committed
Set up sorbet
1 parent a347b3d commit 18910a1

36 files changed

+126820
-2
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ jobs:
2323
with:
2424
ruby-version: ${{ matrix.ruby }}
2525
bundler-cache: true
26-
- name: Run the default task
26+
- name: Run tests
2727
run: bundle exec rake
28+
- name: Run typecheck
29+
run: bundle exec srb tc

.rubocop.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
inherit_gem:
22
rubocop-shopify: rubocop.yml
33

4-
require: rubocop-minitest
4+
require:
5+
- rubocop-minitest
6+
- rubocop-sorbet
57

68
AllCops:
79
SuggestExtensions: false

bin/tapioca

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'tapioca' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
23+
24+
require "rubygems"
25+
require "bundler/setup"
26+
27+
load Gem.bin_path("tapioca", "tapioca")

lib/shopify_ruby_definitions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# typed: strong
12
# frozen_string_literal: true
23

34
require_relative "shopify_ruby_definitions/version"

lib/shopify_ruby_definitions/version.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# typed: strong
12
# frozen_string_literal: true
23

34
module ShopifyRubyDefinitions

shopify-ruby-definitions.gemspec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Gem::Specification.new do |spec|
2929
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
3030
spec.require_paths = ["lib"]
3131

32+
spec.add_dependency("sorbet-runtime")
33+
3234
spec.add_development_dependency("rubocop-minitest")
3335
spec.add_development_dependency("rubocop-shopify")
36+
spec.add_development_dependency("rubocop-sorbet")
37+
spec.add_development_dependency("sorbet")
38+
spec.add_development_dependency("tapioca")
3439
end

sorbet/config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--dir
2+
.
3+
--ignore=tmp/
4+
--ignore=vendor/

sorbet/rbi/annotations/rainbow.rbi

Lines changed: 269 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)