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
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
run: bundle exec rake typecheck:tapioca typecheck:sorbet
- name: Check Steep
run: bundle exec rake typecheck:steep
- name: Validate RBS
run: bundle exec rake typecheck:rbs
- name: Check field kinds
run: rm lib/prism/node.rb && CHECK_FIELD_KIND=true bundle exec rake

Expand Down
1 change: 1 addition & 0 deletions prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ Gem::Specification.new do |spec|
"sig/generated/prism/parse_result/comments.rbs",
"sig/generated/prism/parse_result/errors.rbs",
"sig/generated/prism/parse_result/newlines.rbs",
"sig/manifest.yaml",
"src/arena.c",
"src/buffer.c",
"src/char.c",
Expand Down
15 changes: 15 additions & 0 deletions rakelib/typecheck.rake
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,21 @@ namespace :typecheck do
end
end

desc "Validate the RBS signatures shipped with the gem"
task rbs: :templates do
with_gemfile do
require "yaml"

# Load only what users of the gem get: sig/generated and the standard
# libraries declared in sig/manifest.yaml. sig/_shims is not shipped
# with the gem, so it must not be used here.
dependencies = YAML.safe_load_file("sig/manifest.yaml").fetch("dependencies", [])
libraries = dependencies.flat_map { |dependency| ["-r", dependency.fetch("name")] }

sh "bundle", "exec", "rbs", "-I", "sig/generated", *libraries, "validate"
end
end

desc "Generate RBIs with Tapioca"
task tapioca: :templates do
Rake::Task["compile:prism"].invoke
Expand Down
2 changes: 2 additions & 0 deletions sig/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- name: pp
Loading