Skip to content

Commit

Permalink
Merge pull request #902 from ruby/test-annotations
Browse files Browse the repository at this point in the history
Test annotations
  • Loading branch information
soutaro authored Feb 11, 2022
2 parents c677442 + 5e5bc02 commit 35385df
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: RBS Comments

on:
push:
branches:
- master
pull_request: {}

jobs:
test:
runs-on: "ubuntu-latest"
container:
image: rubylang/ruby:3.1-focal
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
apt-get update
apt-get install -y libdb-dev
- name: Update rubygems & bundler
run: |
ruby -v
gem update --system
- name: bundle config set with
run: |
echo "NO_MINITEST=true" >> $GITHUB_ENV
bundle config set --local without 'minitest'
if: "contains(matrix.container_tag, 'master-nightly')"
- name: bin/setup
run: |
bin/setup
- name: Run test
run: |
bundle exec rake annotate confirm_annotation
13 changes: 11 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ rule ".c" => ".re" do |t|
puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake lexer` ⚠️⚠️⚠️"
end

task :annotate do
sh "rbs annotate core stdlib"
end

task :confirm_annotation do
puts "Testing if RBS docs are updated with respect to RDoc"
sh "git diff --exit-code core stdlib"
end

task :compile => "ext/rbs_extension/lexer.c"

task :test_doc do
Expand Down Expand Up @@ -126,7 +135,7 @@ namespace :generate do
def to_s
@type_name.to_s
end

def absolute_type_name
@absolute_type_name ||= @type_name.absolute!
end
Expand Down Expand Up @@ -223,7 +232,7 @@ namespace :generate do
:~ => 'tilde'
}.fetch(method_name, method_name)
end

def class_methods
@class_methods ||= RBS::DefinitionBuilder.new(env: env).build_singleton(target.absolute_type_name).methods.select {|_, definition|
definition.implemented_in == target.absolute_type_name
Expand Down
1 change: 1 addition & 0 deletions core/encoding.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ class Encoding::Converter < Object
| :destination_buffer_full
| :source_buffer_empty
| :finished

# <!--
# rdoc-file=transcode.c
# - Encoding::Converter.asciicompat_encoding(string) -> encoding or nil
Expand Down

0 comments on commit 35385df

Please sign in to comment.