WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ae43e0c

Browse files
authored
Merge pull request #524 from Shopify/rbs-inline
Migrate to RBS-Inline signatures
2 parents 0031117 + 36aeb7f commit ae43e0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+414
-906
lines changed

.rubocop.sorbet.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Sorbet/EnforceSigilOrder:
2626

2727
Sorbet/EnforceSignatures:
2828
Enabled: true
29+
Style: rbs
2930
Exclude:
3031
- lib/cli/kit/sorbet_runtime_stub.rb
3132
- "test/**/*"

.rubocop.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ inherit_gem:
44
inherit_from:
55
- .rubocop.sorbet.yml
66

7-
require:
8-
- rubocop-sorbet
7+
plugins: rubocop-sorbet
98

109
AllCops:
1110
Exclude:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ group :development, :test do
1515
end
1616

1717
group :typecheck do
18-
gem 'sorbet-static-and-runtime'
18+
gem 'sorbet-static'
1919
gem 'tapioca', require: false
2020
end
2121

Gemfile.lock

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GEM
1515
cli-ui (2.4.0)
1616
docile (1.4.1)
1717
erubi (1.13.1)
18-
json (2.13.2)
18+
json (2.15.1)
1919
language_server-protocol (3.17.0.5)
2020
lint_roller (1.1.0)
2121
logger (1.7.0)
@@ -33,30 +33,29 @@ GEM
3333
parser (3.3.9.0)
3434
ast (~> 2.4.1)
3535
racc
36-
prism (1.4.0)
36+
prism (1.5.1)
3737
racc (1.8.1)
3838
rainbow (3.1.1)
3939
rake (13.3.0)
4040
rbi (0.3.6)
4141
prism (~> 1.0)
4242
rbs (>= 3.4.4)
43-
rbs (3.9.4)
43+
rbs (3.9.5)
4444
logger
45-
regexp_parser (2.10.0)
46-
rexml (3.4.1)
47-
rubocop (1.79.0)
45+
regexp_parser (2.11.3)
46+
rexml (3.4.4)
47+
rubocop (1.81.1)
4848
json (~> 2.3)
4949
language_server-protocol (~> 3.17.0.2)
5050
lint_roller (~> 1.1.0)
5151
parallel (~> 1.10)
5252
parser (>= 3.3.0.2)
5353
rainbow (>= 2.2.2, < 4.0)
5454
regexp_parser (>= 2.9.3, < 3.0)
55-
rubocop-ast (>= 1.46.0, < 2.0)
55+
rubocop-ast (>= 1.47.1, < 2.0)
5656
ruby-progressbar (~> 1.7)
57-
tsort (>= 0.2.0)
5857
unicode-display_width (>= 2.4.0, < 4.0)
59-
rubocop-ast (1.46.0)
58+
rubocop-ast (1.47.1)
6059
parser (>= 3.3.7.2)
6160
prism (~> 1.4)
6261
rubocop-rake (0.7.1)
@@ -75,15 +74,15 @@ GEM
7574
simplecov_json_formatter (~> 0.1)
7675
simplecov-html (0.13.2)
7776
simplecov_json_formatter (0.1.4)
78-
sorbet (0.5.12358)
79-
sorbet-static (= 0.5.12358)
80-
sorbet-runtime (0.5.12358)
81-
sorbet-static (0.5.12358-aarch64-linux)
82-
sorbet-static (0.5.12358-universal-darwin)
83-
sorbet-static (0.5.12358-x86_64-linux)
84-
sorbet-static-and-runtime (0.5.12358)
85-
sorbet (= 0.5.12358)
86-
sorbet-runtime (= 0.5.12358)
77+
sorbet (0.6.12627)
78+
sorbet-static (= 0.6.12627)
79+
sorbet-runtime (0.6.12627)
80+
sorbet-static (0.6.12627-aarch64-linux)
81+
sorbet-static (0.6.12627-universal-darwin)
82+
sorbet-static (0.6.12627-x86_64-linux)
83+
sorbet-static-and-runtime (0.6.12627)
84+
sorbet (= 0.6.12627)
85+
sorbet-runtime (= 0.6.12627)
8786
spoom (1.6.3)
8887
erubi (>= 1.10.0)
8988
prism (>= 0.28.0)
@@ -102,10 +101,9 @@ GEM
102101
thor (>= 1.2.0)
103102
yard-sorbet
104103
thor (1.4.0)
105-
tsort (0.2.0)
106-
unicode-display_width (3.1.4)
107-
unicode-emoji (~> 4.0, >= 4.0.4)
108-
unicode-emoji (4.0.4)
104+
unicode-display_width (3.2.0)
105+
unicode-emoji (~> 4.1)
106+
unicode-emoji (4.1.0)
109107
yard (0.9.37)
110108
yard-sorbet (0.9.0)
111109
sorbet-runtime
@@ -131,7 +129,7 @@ DEPENDENCIES
131129
rubocop-shopify
132130
rubocop-sorbet
133131
simplecov
134-
sorbet-static-and-runtime
132+
sorbet-static
135133
tapioca
136134

137135
BUNDLED WITH

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ $LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
22
require 'rake/testtask'
33
require 'rubocop/rake_task'
44
require 'bundler/gem_tasks'
5-
require 'sorbet-runtime' unless ENV['BUNDLE_WITHOUT'] == 'typecheck'
65

76
TEST_ROOT = File.expand_path('../test', __FILE__)
87

bin/testunit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require 'rubygems'
44
require 'bundler/setup'
5-
require 'sorbet-runtime' unless ENV['BUNDLE_WITHOUT'] == 'typecheck'
65

76
root = File.expand_path('../..', __FILE__)
87
CLI_TEST_ROOT = root + '/test'

examples/minimal/example.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
registry = CommandRegistry.new(default: 'hello')
1212
registry.add(
1313
Class.new(BaseCommand) do
14-
sig { params(_args: T::Array[String], _name: String).void }
14+
#: (Array[String], String) -> void
1515
def call(_args, _name)
1616
puts 'hello, world!'
1717
end

examples/single-file/example.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Commands
1515
Registry = CLI::Kit::CommandRegistry.new(default: 'hello')
1616

1717
class << self
18-
sig { params(const: Symbol, cmd: String, path: String, lamda_const: T.proc.returns(Example::Command)).void }
18+
#: (Symbol const, String cmd, String path, ^-> Example::Command lamda_const) -> void
1919
def register(const, cmd, path, lamda_const)
2020
autoload(const, path)
2121
Registry.add(lamda_const, cmd)
@@ -25,7 +25,8 @@ def register(const, cmd, path, lamda_const)
2525
end
2626

2727
class Hello < Example::Command
28-
sig { override.params(_args: T::Array[String], _name: String).void }
28+
# @override
29+
#: (Array[String] _args, String _name) -> void
2930
def call(_args, _name)
3031
puts 'hello, world!'
3132
end
@@ -34,7 +35,7 @@ def call(_args, _name)
3435

3536
module EntryPoint
3637
class << self
37-
sig { params(args: T::Array[String]).void }
38+
#: (Array[String] args) -> void
3839
def call(args)
3940
cmd, command_name, args = Example::Resolver.call(args)
4041
Example::Executor.call(cmd, command_name, args)

gen/lib/gen/commands.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44

55
module Gen
66
module Commands
7-
extend T::Sig
8-
97
Registry = CLI::Kit::CommandRegistry.new(default: 'help')
108

119
class << self
12-
extend T::Sig
13-
14-
sig do
15-
params(const: Symbol, cmd: String, path: String, lamda_const: T.proc.returns(T.class_of(Gen::Command))).void
16-
end
10+
#: (Symbol const, String cmd, String path, ^-> singleton(Gen::Command) lamda_const) -> void
1711
def register(const, cmd, path, lamda_const)
1812
autoload(const, path)
1913
Registry.add(lamda_const, cmd)

gen/lib/gen/commands/help.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
module Gen
66
module Commands
77
class Help < Gen::Command
8-
extend T::Sig
9-
108
desc('Show help for a command, or this page')
119

12-
sig { params(args: T::Array[String], _name: String).void }
10+
#: (Array[String] args, String _name) -> void
1311
def call(args, _name)
1412
Gen::Help.generate(args)
1513
end

0 commit comments

Comments
 (0)