Skip to content

Commit 62b1318

Browse files
authored
Ruby: Check RBS validity on CI (#1712)
To avoid the regressions of the RBS definition, this adds automatic RBS validation on CI. This also contains the following changes around RBS: * Update to RBS-4.0 and Steep-2.0 * Manage types of dependencies via rbs_collection.yaml (see https://github.com/ruby/rbs/blob/master/docs/collection.md) ref: #1711 (review)
1 parent b764e03 commit 62b1318

10 files changed

Lines changed: 442 additions & 51 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ jobs:
5353
- name: Lint
5454
run: bin/lint
5555

56+
- name: RBS Validation
57+
run: |-
58+
bundle exec rbs collection install --frozen
59+
bundle exec rbs -Isig validate
60+
5661
- name: Steep
5762
run: bundle exec steep check
5863

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ tmp/*
7575
# Bundler Config
7676
!/.bundle/config
7777

78+
# RBS Collection files
79+
.gem_rbs_collection/*
80+
7881
# Bundler
7982
vendor/*
8083
vendor/bundle/*

Gemfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,5 @@ gem "reactionview", "~> 0.3.0"
2424
gem "reline", "~> 0.6"
2525
gem "rubocop", "~> 1.71"
2626
gem "sorbet"
27+
gem "steep", "~> 2.0"
2728
gem "turbo-rails", "~> 2.0"
28-
29-
# TODO: Remove once https://github.com/ruby/rbs/pull/2850 is merged and released
30-
gem "rbs", github: "marcoroth/rbs", branch: "psych-load-unsafe-file"
31-
gem "steep", github: "soutaro/steep", branch: "master"

Gemfile.lock

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,10 @@
1-
GIT
2-
remote: https://github.com/marcoroth/rbs.git
3-
revision: 6ed90f144c592a5d744b1a03df42bf834f137416
4-
branch: psych-load-unsafe-file
5-
specs:
6-
rbs (4.0.0.dev.5)
7-
logger
8-
prism (>= 1.6.0)
9-
tsort
10-
111
GIT
122
remote: https://github.com/ruby/prism.git
133
revision: c0e37816e97e23e92524a4070e1b99a4025bc63f
144
tag: v1.9.0
155
specs:
166
prism (1.9.0)
177

18-
GIT
19-
remote: https://github.com/soutaro/steep.git
20-
revision: 03e3440e16b64f314c9c7b5afd33888fb74ac11a
21-
branch: master
22-
specs:
23-
steep (2.0.0.dev)
24-
activesupport (>= 5.1)
25-
concurrent-ruby (>= 1.1.10)
26-
csv (>= 3.0.9)
27-
fileutils (>= 1.1.0)
28-
json (>= 2.1.0)
29-
language_server-protocol (>= 3.17.0.4, < 4.0)
30-
listen (~> 3.0)
31-
logger (>= 1.3.0)
32-
mutex_m (>= 0.3.0)
33-
parser (>= 3.2)
34-
rainbow (>= 2.2.2, < 4.0)
35-
rbs (~> 4.0.0.dev)
36-
securerandom (>= 0.1)
37-
strscan (>= 1.0.0)
38-
terminal-table (>= 2, < 5)
39-
uri (>= 0.12.0)
40-
418
PATH
429
remote: .
4310
specs:
@@ -185,7 +152,6 @@ GEM
185152
minitest (5.27.0)
186153
minitest-difftastic (0.2.1)
187154
difftastic (~> 0.6)
188-
mutex_m (0.3.0)
189155
nokogiri (1.19.3-aarch64-linux-gnu)
190156
racc (~> 1.4)
191157
nokogiri (1.19.3-aarch64-linux-musl)
@@ -249,6 +215,10 @@ GEM
249215
rb-fsevent (0.11.2)
250216
rb-inotify (0.11.1)
251217
ffi (~> 1.0)
218+
rbs (4.0.2)
219+
logger
220+
prism (>= 1.6.0)
221+
tsort
252222
rbs-inline (0.13.0)
253223
prism (>= 0.29)
254224
rbs (>= 3.8.0)
@@ -283,6 +253,22 @@ GEM
283253
sorbet-static (0.6.13185-aarch64-linux)
284254
sorbet-static (0.6.13185-universal-darwin)
285255
sorbet-static (0.6.13185-x86_64-linux)
256+
steep (2.0.0)
257+
concurrent-ruby (>= 1.1.10)
258+
csv (>= 3.0.9)
259+
fileutils (>= 1.1.0)
260+
json (>= 2.1.0)
261+
language_server-protocol (>= 3.17.0.4, < 4.0)
262+
listen (~> 3.0)
263+
logger (>= 1.3.0)
264+
parser (>= 3.2)
265+
prism (>= 0.25.0)
266+
rainbow (>= 2.2.2, < 4.0)
267+
rbs (~> 4.0)
268+
securerandom (>= 0.1)
269+
strscan (>= 1.0.0)
270+
terminal-table (>= 2, < 5)
271+
uri (>= 0.12.0)
286272
stringio (3.2.0)
287273
strscan (3.1.7)
288274
terminal-table (4.0.0)
@@ -328,13 +314,12 @@ DEPENDENCIES
328314
rake (~> 13.4)
329315
rake-compiler (~> 1.3)
330316
rake-compiler-dock (~> 1.12)
331-
rbs!
332317
rbs-inline (~> 0.13)
333318
reactionview (~> 0.3.0)
334319
reline (~> 0.6)
335320
rubocop (~> 1.71)
336321
sorbet
337-
steep!
322+
steep (~> 2.0)
338323
turbo-rails (~> 2.0)
339324

340325
BUNDLED WITH

Steepfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ target :lib do
66
check "lib"
77

88
library "delegate"
9+
library "did_you_mean"
910
library "digest"
1011
library "json"
1112
library "pathname"

lib/herb/action_view/render_analyzer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def process_file_for_render_calls(file)
784784
def ensure_parallel!
785785
return if defined?(Parallel)
786786

787-
Herb.ensure_installed { gem "parallel" } # steep:ignore
787+
Herb.ensure_installed { gem "parallel" }
788788
end
789789

790790
def collect_ruby_render_references

0 commit comments

Comments
 (0)