rbs 4.0.0.dev.4 → 4.0.0.dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -14
- data/.github/workflows/bundle-update.yml +60 -0
- data/.github/workflows/c-check.yml +11 -8
- data/.github/workflows/comments.yml +3 -3
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +17 -34
- data/.github/workflows/typecheck.yml +2 -2
- data/.github/workflows/valgrind.yml +42 -0
- data/.github/workflows/windows.yml +2 -2
- data/.rubocop.yml +1 -1
- data/README.md +1 -1
- data/Rakefile +32 -5
- data/config.yml +46 -0
- data/core/array.rbs +96 -46
- data/core/binding.rbs +0 -2
- data/core/builtin.rbs +2 -2
- data/core/comparable.rbs +13 -6
- data/core/complex.rbs +55 -41
- data/core/dir.rbs +4 -4
- data/core/encoding.rbs +7 -10
- data/core/enumerable.rbs +90 -3
- data/core/enumerator/arithmetic_sequence.rbs +70 -0
- data/core/enumerator.rbs +63 -1
- data/core/errno.rbs +8 -0
- data/core/errors.rbs +28 -1
- data/core/exception.rbs +2 -2
- data/core/fiber.rbs +40 -20
- data/core/file.rbs +108 -78
- data/core/file_test.rbs +1 -1
- data/core/float.rbs +225 -69
- data/core/gc.rbs +417 -281
- data/core/hash.rbs +1023 -727
- data/core/integer.rbs +104 -110
- data/core/io/buffer.rbs +21 -10
- data/core/io/wait.rbs +11 -33
- data/core/io.rbs +82 -19
- data/core/kernel.rbs +70 -59
- data/core/marshal.rbs +1 -1
- data/core/match_data.rbs +1 -1
- data/core/math.rbs +42 -3
- data/core/method.rbs +63 -27
- data/core/module.rbs +103 -26
- data/core/nil_class.rbs +3 -3
- data/core/numeric.rbs +43 -35
- data/core/object.rbs +3 -3
- data/core/object_space.rbs +21 -15
- data/core/pathname.rbs +1272 -0
- data/core/proc.rbs +30 -25
- data/core/process.rbs +4 -2
- data/core/ractor.rbs +361 -509
- data/core/random.rbs +17 -0
- data/core/range.rbs +113 -16
- data/core/rational.rbs +56 -85
- data/core/rbs/unnamed/argf.rbs +2 -2
- data/core/rbs/unnamed/env_class.rbs +1 -1
- data/core/rbs/unnamed/random.rbs +4 -113
- data/core/regexp.rbs +25 -20
- data/core/ruby.rbs +53 -0
- data/core/ruby_vm.rbs +6 -4
- data/core/rubygems/errors.rbs +3 -70
- data/core/rubygems/rubygems.rbs +11 -79
- data/core/rubygems/version.rbs +2 -3
- data/core/set.rbs +488 -359
- data/core/signal.rbs +24 -14
- data/core/string.rbs +3171 -1241
- data/core/struct.rbs +1 -1
- data/core/symbol.rbs +17 -11
- data/core/thread.rbs +95 -33
- data/core/time.rbs +35 -9
- data/core/trace_point.rbs +7 -4
- data/core/unbound_method.rbs +14 -6
- data/docs/aliases.md +79 -0
- data/docs/collection.md +2 -2
- data/docs/encoding.md +56 -0
- data/docs/gem.md +0 -1
- data/docs/inline.md +470 -0
- data/docs/sigs.md +3 -3
- data/docs/syntax.md +33 -4
- data/docs/type_fingerprint.md +21 -0
- data/exe/rbs +1 -1
- data/ext/rbs_extension/ast_translation.c +77 -3
- data/ext/rbs_extension/ast_translation.h +3 -0
- data/ext/rbs_extension/class_constants.c +8 -2
- data/ext/rbs_extension/class_constants.h +4 -0
- data/ext/rbs_extension/extconf.rb +5 -1
- data/ext/rbs_extension/legacy_location.c +5 -5
- data/ext/rbs_extension/main.c +37 -20
- data/include/rbs/ast.h +85 -38
- data/include/rbs/defines.h +27 -0
- data/include/rbs/lexer.h +30 -11
- data/include/rbs/parser.h +6 -6
- data/include/rbs/string.h +0 -2
- data/include/rbs/util/rbs_allocator.h +34 -13
- data/include/rbs/util/rbs_assert.h +12 -1
- data/include/rbs/util/rbs_encoding.h +2 -0
- data/include/rbs/util/rbs_unescape.h +2 -1
- data/lib/rbs/ast/annotation.rb +1 -1
- data/lib/rbs/ast/comment.rb +1 -1
- data/lib/rbs/ast/declarations.rb +10 -10
- data/lib/rbs/ast/members.rb +14 -14
- data/lib/rbs/ast/ruby/annotations.rb +137 -0
- data/lib/rbs/ast/ruby/comment_block.rb +24 -0
- data/lib/rbs/ast/ruby/declarations.rb +198 -3
- data/lib/rbs/ast/ruby/helpers/constant_helper.rb +4 -0
- data/lib/rbs/ast/ruby/members.rb +159 -1
- data/lib/rbs/ast/type_param.rb +24 -4
- data/lib/rbs/buffer.rb +20 -15
- data/lib/rbs/cli/diff.rb +16 -15
- data/lib/rbs/cli/validate.rb +38 -51
- data/lib/rbs/cli.rb +52 -19
- data/lib/rbs/collection/config/lockfile_generator.rb +8 -0
- data/lib/rbs/collection/sources/git.rb +1 -0
- data/lib/rbs/definition.rb +1 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +62 -9
- data/lib/rbs/definition_builder/method_builder.rb +20 -0
- data/lib/rbs/definition_builder.rb +91 -2
- data/lib/rbs/diff.rb +7 -1
- data/lib/rbs/environment.rb +227 -74
- data/lib/rbs/environment_loader.rb +0 -6
- data/lib/rbs/errors.rb +27 -7
- data/lib/rbs/inline_parser.rb +341 -5
- data/lib/rbs/location_aux.rb +1 -1
- data/lib/rbs/locator.rb +5 -1
- data/lib/rbs/method_type.rb +5 -3
- data/lib/rbs/parser_aux.rb +2 -2
- data/lib/rbs/prototype/rb.rb +2 -2
- data/lib/rbs/prototype/rbi.rb +2 -0
- data/lib/rbs/prototype/runtime.rb +8 -0
- data/lib/rbs/resolver/constant_resolver.rb +2 -2
- data/lib/rbs/resolver/type_name_resolver.rb +116 -38
- data/lib/rbs/subtractor.rb +3 -1
- data/lib/rbs/test/type_check.rb +16 -2
- data/lib/rbs/type_name.rb +1 -1
- data/lib/rbs/types.rb +27 -27
- data/lib/rbs/validator.rb +2 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +1 -1
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +1 -1
- data/rbs.gemspec +3 -2
- data/schema/typeParam.json +17 -1
- data/sig/ast/ruby/annotations.rbs +124 -0
- data/sig/ast/ruby/comment_block.rbs +8 -0
- data/sig/ast/ruby/declarations.rbs +102 -4
- data/sig/ast/ruby/members.rbs +87 -1
- data/sig/cli/diff.rbs +5 -11
- data/sig/cli/validate.rbs +13 -4
- data/sig/cli.rbs +18 -18
- data/sig/definition.rbs +6 -1
- data/sig/environment.rbs +70 -12
- data/sig/errors.rbs +13 -6
- data/sig/inline_parser.rbs +39 -2
- data/sig/locator.rbs +0 -2
- data/sig/manifest.yaml +0 -1
- data/sig/method_builder.rbs +3 -1
- data/sig/method_types.rbs +1 -1
- data/sig/parser.rbs +16 -2
- data/sig/resolver/type_name_resolver.rbs +35 -7
- data/sig/source.rbs +3 -3
- data/sig/type_param.rbs +13 -8
- data/sig/types.rbs +4 -4
- data/src/ast.c +80 -1
- data/src/lexer.c +1392 -1313
- data/src/lexer.re +3 -0
- data/src/lexstate.c +58 -37
- data/src/location.c +4 -4
- data/src/parser.c +412 -145
- data/src/string.c +0 -48
- data/src/util/rbs_allocator.c +89 -71
- data/src/util/rbs_assert.c +1 -1
- data/src/util/rbs_buffer.c +2 -2
- data/src/util/rbs_constant_pool.c +10 -10
- data/src/util/rbs_encoding.c +4 -8
- data/src/util/rbs_unescape.c +56 -20
- data/stdlib/bigdecimal/0/big_decimal.rbs +100 -82
- data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
- data/stdlib/cgi/0/core.rbs +9 -393
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/cgi-escape/0/escape.rbs +171 -0
- data/stdlib/coverage/0/coverage.rbs +3 -1
- data/stdlib/date/0/date.rbs +67 -59
- data/stdlib/date/0/date_time.rbs +1 -1
- data/stdlib/delegate/0/delegator.rbs +10 -7
- data/stdlib/digest/0/digest.rbs +110 -0
- data/stdlib/erb/0/erb.rbs +737 -347
- data/stdlib/fileutils/0/fileutils.rbs +20 -14
- data/stdlib/forwardable/0/forwardable.rbs +3 -0
- data/stdlib/json/0/json.rbs +82 -28
- data/stdlib/net-http/0/net-http.rbs +3 -0
- data/stdlib/objspace/0/objspace.rbs +9 -27
- data/stdlib/open-uri/0/open-uri.rbs +40 -0
- data/stdlib/open3/0/open3.rbs +459 -1
- data/stdlib/openssl/0/openssl.rbs +331 -228
- data/stdlib/optparse/0/optparse.rbs +8 -3
- data/stdlib/pathname/0/pathname.rbs +9 -1379
- data/stdlib/psych/0/psych.rbs +4 -4
- data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
- data/stdlib/rdoc/0/code_object.rbs +2 -1
- data/stdlib/rdoc/0/parser.rbs +1 -1
- data/stdlib/rdoc/0/rdoc.rbs +1 -1
- data/stdlib/rdoc/0/store.rbs +1 -1
- data/stdlib/resolv/0/resolv.rbs +25 -68
- data/stdlib/ripper/0/ripper.rbs +2 -2
- data/stdlib/securerandom/0/manifest.yaml +2 -0
- data/stdlib/securerandom/0/securerandom.rbs +6 -19
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/socket/0/socket.rbs +13 -1
- data/stdlib/socket/0/tcp_socket.rbs +10 -2
- data/stdlib/stringio/0/stringio.rbs +1176 -85
- data/stdlib/strscan/0/string_scanner.rbs +31 -31
- data/stdlib/tempfile/0/tempfile.rbs +3 -3
- data/stdlib/time/0/time.rbs +1 -1
- data/stdlib/timeout/0/timeout.rbs +63 -7
- data/stdlib/tsort/0/cyclic.rbs +3 -0
- data/stdlib/uri/0/common.rbs +16 -2
- data/stdlib/uri/0/file.rbs +1 -1
- data/stdlib/uri/0/generic.rbs +24 -16
- data/stdlib/uri/0/rfc2396_parser.rbs +6 -7
- data/stdlib/zlib/0/gzip_reader.rbs +2 -2
- data/stdlib/zlib/0/gzip_writer.rbs +1 -1
- data/stdlib/zlib/0/zstream.rbs +1 -0
- metadata +30 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 803c356414679e6271a26f25094f449ae5cbf684047ea6d5ea3f973382b34a7e
|
|
4
|
+
data.tar.gz: 5ee41851402e87dc52910143a0babfed109abd6518b89083d39ee6b88e266078
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6feb377cf58019cdadc53a5fad61a365d87c197f871d889d70efd4427db9ba6f433648c9c7684eba85f0f74a15f59a8cb0aef91cdfe5478b8d685547545a787
|
|
7
|
+
data.tar.gz: 7e5f1555240f1e2f96696aa73b11b12643c020c4ae705d20d84524814c1c5da7245fac88a10636f6a3bcf0488343d3a82b2dd8e7623447d0e9ef8c1618e77b84
|
data/.github/dependabot.yml
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
version: 2
|
|
2
2
|
updates:
|
|
3
|
-
- package-ecosystem: bundler
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
# - package-ecosystem: bundler
|
|
4
|
+
# directory: "/"
|
|
5
|
+
# schedule:
|
|
6
|
+
# interval: daily
|
|
7
|
+
# open-pull-requests-limit: 3
|
|
8
|
+
# allow:
|
|
9
|
+
# - dependency-type: all
|
|
10
10
|
|
|
11
|
-
- package-ecosystem: bundler
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
# - package-ecosystem: bundler
|
|
12
|
+
# directory: "/steep"
|
|
13
|
+
# schedule:
|
|
14
|
+
# interval: daily
|
|
15
|
+
# open-pull-requests-limit: 3
|
|
16
|
+
# allow:
|
|
17
|
+
# - dependency-type: all
|
|
18
18
|
|
|
19
19
|
- package-ecosystem: 'github-actions'
|
|
20
20
|
directory: '/'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Scheduled Bundle Update PR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 0 * * 2'
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
bundle-update:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout repository
|
|
14
|
+
uses: actions/checkout@v6
|
|
15
|
+
|
|
16
|
+
- name: Set up Ruby
|
|
17
|
+
uses: ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: '4.0'
|
|
20
|
+
|
|
21
|
+
- name: Set up git
|
|
22
|
+
run: |
|
|
23
|
+
git config --global user.name "github-actions[bot]"
|
|
24
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
25
|
+
|
|
26
|
+
- name: Switch branch
|
|
27
|
+
run: |
|
|
28
|
+
git switch -c bundle-update-$(date +'%Y%m%d')-$(uuidgen | cut -c1-8)
|
|
29
|
+
|
|
30
|
+
- name: Install bundler
|
|
31
|
+
run: gem install bundler
|
|
32
|
+
|
|
33
|
+
- name: Run bundle update
|
|
34
|
+
run: |
|
|
35
|
+
bundle lock --update
|
|
36
|
+
bundle lock --update --gemfile=steep/Gemfile
|
|
37
|
+
git add Gemfile.lock steep/Gemfile.lock
|
|
38
|
+
|
|
39
|
+
if git diff --cached --exit-code; then
|
|
40
|
+
echo "No changes to commit, exiting."
|
|
41
|
+
exit 0
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
git commit -m "bundle update"
|
|
45
|
+
echo "has_update=true" >> $GITHUB_ENV
|
|
46
|
+
|
|
47
|
+
- name: Push branch
|
|
48
|
+
if: env.has_update == 'true'
|
|
49
|
+
run: git push origin HEAD
|
|
50
|
+
|
|
51
|
+
- name: Create Pull Request
|
|
52
|
+
if: env.has_update == 'true'
|
|
53
|
+
env:
|
|
54
|
+
GH_TOKEN: ${{ secrets.DEPENDABOT_MERGE_GH_TOKEN }}
|
|
55
|
+
run: |
|
|
56
|
+
gh pr create \
|
|
57
|
+
--title "bundle update ($(date +'%Y-%m-%d'))" \
|
|
58
|
+
--body "Automated weekly bundle update" \
|
|
59
|
+
--head "$(git rev-parse --abbrev-ref HEAD)" \
|
|
60
|
+
--base "${{ github.event.repository.default_branch }}"
|
|
@@ -9,10 +9,10 @@ jobs:
|
|
|
9
9
|
format-check:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
13
|
- uses: ruby/setup-ruby@v1
|
|
14
14
|
with:
|
|
15
|
-
ruby-version: "
|
|
15
|
+
ruby-version: "4.0"
|
|
16
16
|
bundler-cache: none
|
|
17
17
|
- name: Set working directory as safe
|
|
18
18
|
run: git config --global --add safe.directory $(pwd)
|
|
@@ -23,19 +23,22 @@ jobs:
|
|
|
23
23
|
- name: Install clang-format from LLVM
|
|
24
24
|
run: |
|
|
25
25
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
|
26
|
-
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
|
|
26
|
+
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main"
|
|
27
27
|
sudo apt-get update
|
|
28
|
-
sudo apt-get install -y clang-format
|
|
28
|
+
sudo apt-get install -y clang-format-20
|
|
29
|
+
sudo ln -sf /usr/bin/clang-format-20 /usr/local/bin/clang-format
|
|
29
30
|
clang-format --version
|
|
31
|
+
- name: Count processors
|
|
32
|
+
run: nproc
|
|
30
33
|
- name: Install Re2c
|
|
31
34
|
run: |
|
|
32
35
|
cd /tmp
|
|
33
|
-
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.
|
|
34
|
-
tar xf re2c-3.
|
|
35
|
-
cd re2c-3
|
|
36
|
+
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/4.3.tar.gz > re2c-4.3.tar.gz
|
|
37
|
+
tar xf re2c-4.3.tar.gz
|
|
38
|
+
cd re2c-4.3
|
|
36
39
|
autoreconf -i -W all
|
|
37
40
|
./configure
|
|
38
|
-
make
|
|
41
|
+
make -j"$(nproc)" -l"$(nproc)"
|
|
39
42
|
sudo make install
|
|
40
43
|
- name: Update rubygems & bundler
|
|
41
44
|
run: |
|
|
@@ -11,12 +11,12 @@ jobs:
|
|
|
11
11
|
comments:
|
|
12
12
|
runs-on: "ubuntu-latest"
|
|
13
13
|
# env:
|
|
14
|
-
# RUBY_COMMIT:
|
|
14
|
+
# RUBY_COMMIT: v4.0.0-preview2
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
17
|
- uses: ruby/setup-ruby@v1
|
|
18
18
|
with:
|
|
19
|
-
ruby-version: "
|
|
19
|
+
ruby-version: "4.0.0"
|
|
20
20
|
bundler: none
|
|
21
21
|
- name: Install dependencies
|
|
22
22
|
run: |
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
|
|
18
18
|
id: metadata
|
|
19
19
|
- name: Checkout repository
|
|
20
|
-
uses: actions/checkout@
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
21
|
with:
|
|
22
22
|
fetch-depth: 0
|
|
23
23
|
- name: Abort if blocker files are changed
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -13,29 +13,29 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
matrix:
|
|
16
|
-
ruby: ['3.
|
|
16
|
+
ruby: ['3.2', '3.3', '3.4', '4.0', head]
|
|
17
17
|
rubyopt: [""]
|
|
18
18
|
job:
|
|
19
19
|
- test
|
|
20
20
|
include:
|
|
21
21
|
- ruby: head
|
|
22
22
|
job: stdlib_test rubocop
|
|
23
|
-
- ruby: "
|
|
23
|
+
- ruby: "4.0"
|
|
24
24
|
job: stdlib_test
|
|
25
|
-
- ruby: "
|
|
25
|
+
- ruby: "4.0"
|
|
26
26
|
job: test
|
|
27
27
|
rubyopt: "--enable-frozen-string-literal"
|
|
28
|
-
- ruby: "
|
|
28
|
+
- ruby: "4.0"
|
|
29
29
|
job: stdlib_test
|
|
30
30
|
rubyopt: "--enable-frozen-string-literal"
|
|
31
|
-
- ruby: "
|
|
31
|
+
- ruby: "4.0"
|
|
32
32
|
job: rubocop validate test_doc build test_generate_stdlib raap
|
|
33
|
-
- ruby: "
|
|
33
|
+
- ruby: "4.0"
|
|
34
34
|
job: typecheck_test
|
|
35
35
|
env:
|
|
36
36
|
RANDOMIZE_STDLIB_TEST_ORDER: "true"
|
|
37
37
|
steps:
|
|
38
|
-
- uses: actions/checkout@
|
|
38
|
+
- uses: actions/checkout@v6
|
|
39
39
|
- uses: ruby/setup-ruby@v1
|
|
40
40
|
with:
|
|
41
41
|
ruby-version: ${{ matrix.ruby }}
|
|
@@ -55,6 +55,10 @@ jobs:
|
|
|
55
55
|
echo "NO_MINITEST=true" >> $GITHUB_ENV
|
|
56
56
|
bundle config set --local without 'minitest'
|
|
57
57
|
if: ${{ contains(matrix.ruby, 'head') }}
|
|
58
|
+
- name: bundle config set force_ruby_platform true if head
|
|
59
|
+
if: ${{ contains(matrix.ruby, 'head') }}
|
|
60
|
+
run: |
|
|
61
|
+
bundle config set force_ruby_platform true
|
|
58
62
|
- name: Skip installing type checkers
|
|
59
63
|
if: ${{ ! contains(matrix.job, 'typecheck_test') }}
|
|
60
64
|
run: |
|
|
@@ -65,38 +69,14 @@ jobs:
|
|
|
65
69
|
- name: Run test
|
|
66
70
|
run: |
|
|
67
71
|
bundle exec rake ${{ matrix.job }}
|
|
68
|
-
valgrind:
|
|
69
|
-
runs-on: ubuntu-latest
|
|
70
|
-
steps:
|
|
71
|
-
- uses: actions/checkout@v4
|
|
72
|
-
- uses: ruby/setup-ruby@v1
|
|
73
|
-
with:
|
|
74
|
-
ruby-version: "3.4"
|
|
75
|
-
bundler-cache: none
|
|
76
|
-
- name: Set working directory as safe
|
|
77
|
-
run: git config --global --add safe.directory $(pwd)
|
|
78
|
-
- name: Install dependencies
|
|
79
|
-
run: |
|
|
80
|
-
sudo apt-get update
|
|
81
|
-
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
|
|
82
|
-
- name: Update rubygems & bundler
|
|
83
|
-
run: |
|
|
84
|
-
ruby -v
|
|
85
|
-
gem update --system
|
|
86
|
-
- name: bin/setup
|
|
87
|
-
run: |
|
|
88
|
-
bin/setup
|
|
89
|
-
- run: bundle exec rake test:valgrind
|
|
90
|
-
env:
|
|
91
|
-
RUBY_FREE_AT_EXIT: 1
|
|
92
72
|
C99_compile:
|
|
93
73
|
runs-on: macos-latest
|
|
94
74
|
strategy:
|
|
95
75
|
fail-fast: false
|
|
96
76
|
matrix:
|
|
97
|
-
ruby: ['
|
|
77
|
+
ruby: ['4.0', head]
|
|
98
78
|
steps:
|
|
99
|
-
- uses: actions/checkout@
|
|
79
|
+
- uses: actions/checkout@v6
|
|
100
80
|
- name: Install dependencies
|
|
101
81
|
run: |
|
|
102
82
|
brew install ruby-build
|
|
@@ -112,8 +92,11 @@ jobs:
|
|
|
112
92
|
gem update --system
|
|
113
93
|
- name: clang version
|
|
114
94
|
run: clang --version
|
|
95
|
+
- name: bundle config set force_ruby_platform true if head
|
|
96
|
+
if: ${{ contains(matrix.ruby, 'head') }}
|
|
97
|
+
run: |
|
|
98
|
+
bundle config set force_ruby_platform true
|
|
115
99
|
- name: bin/setup
|
|
116
100
|
run: |
|
|
117
101
|
bin/setup
|
|
118
102
|
- run: bundle exec rake clean compile_c99
|
|
119
|
-
|
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
17
|
- uses: ruby/setup-ruby@v1
|
|
18
18
|
with:
|
|
19
|
-
ruby-version: "3.
|
|
19
|
+
ruby-version: "3.4"
|
|
20
20
|
bundler: none
|
|
21
21
|
- name: Set working directory as safe
|
|
22
22
|
run: git config --global --add safe.directory $(pwd)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Valgrind
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
paths:
|
|
8
|
+
- "ext/**"
|
|
9
|
+
- "include/**"
|
|
10
|
+
- "src/**"
|
|
11
|
+
pull_request:
|
|
12
|
+
paths:
|
|
13
|
+
- "ext/**"
|
|
14
|
+
- "include/**"
|
|
15
|
+
- "src/**"
|
|
16
|
+
merge_group: {}
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
valgrind:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
- uses: ruby/setup-ruby@v1
|
|
24
|
+
with:
|
|
25
|
+
ruby-version: "3.4"
|
|
26
|
+
bundler-cache: none
|
|
27
|
+
- name: Set working directory as safe
|
|
28
|
+
run: git config --global --add safe.directory $(pwd)
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
sudo apt-get update
|
|
32
|
+
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
|
|
33
|
+
- name: Update rubygems & bundler
|
|
34
|
+
run: |
|
|
35
|
+
ruby -v
|
|
36
|
+
gem update --system
|
|
37
|
+
- name: bin/setup
|
|
38
|
+
run: |
|
|
39
|
+
bin/setup
|
|
40
|
+
- run: bundle exec rake test:valgrind
|
|
41
|
+
env:
|
|
42
|
+
RUBY_FREE_AT_EXIT: 1
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
|
@@ -141,7 +141,7 @@ require "rbs"
|
|
|
141
141
|
loader = RBS::EnvironmentLoader.new()
|
|
142
142
|
|
|
143
143
|
# loader.add(path: Pathname("sig")) # Load .rbs files from `sig` directory
|
|
144
|
-
# loader.add(library: "
|
|
144
|
+
# loader.add(library: "logger") # Load logger library
|
|
145
145
|
|
|
146
146
|
environment = RBS::Environment.from_loader(loader).resolve_type_names
|
|
147
147
|
|
data/Rakefile
CHANGED
|
@@ -25,6 +25,12 @@ test_config = lambda do |t|
|
|
|
25
25
|
t.test_files = FileList["test/**/*_test.rb"].reject do |path|
|
|
26
26
|
path =~ %r{test/stdlib/}
|
|
27
27
|
end
|
|
28
|
+
if defined?(RubyMemcheck)
|
|
29
|
+
if t.is_a?(RubyMemcheck::TestTask)
|
|
30
|
+
t.verbose = true
|
|
31
|
+
t.options = '-v'
|
|
32
|
+
end
|
|
33
|
+
end
|
|
28
34
|
end
|
|
29
35
|
|
|
30
36
|
Rake::TestTask.new(test: :compile, &test_config)
|
|
@@ -206,7 +212,14 @@ task :validate => :compile do
|
|
|
206
212
|
end
|
|
207
213
|
|
|
208
214
|
libs.each do |lib|
|
|
209
|
-
|
|
215
|
+
args = ["-r", lib]
|
|
216
|
+
|
|
217
|
+
if lib == "rbs"
|
|
218
|
+
args << "-r"
|
|
219
|
+
args << "prism"
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
sh "#{ruby} #{rbs} #{args.join(' ')} validate --exit-error-on-syntax-error"
|
|
210
223
|
end
|
|
211
224
|
end
|
|
212
225
|
|
|
@@ -218,7 +231,7 @@ end
|
|
|
218
231
|
|
|
219
232
|
task :stdlib_test => :compile do
|
|
220
233
|
test_files = FileList["test/stdlib/**/*_test.rb"].reject do |path|
|
|
221
|
-
path =~ %r{Ractor} || path =~ %r{Encoding} || path =~ %r{
|
|
234
|
+
path =~ %r{Ractor} || path =~ %r{Encoding} || path =~ %r{CGI-escape_test}
|
|
222
235
|
end
|
|
223
236
|
|
|
224
237
|
if ENV["RANDOMIZE_STDLIB_TEST_ORDER"] == "true"
|
|
@@ -227,7 +240,7 @@ task :stdlib_test => :compile do
|
|
|
227
240
|
|
|
228
241
|
sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test_files.join(' ')}"
|
|
229
242
|
# TODO: Ractor tests need to be run in a separate process
|
|
230
|
-
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/
|
|
243
|
+
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/CGI-escape_test.rb"
|
|
231
244
|
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Ractor_test.rb"
|
|
232
245
|
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Encoding_test.rb"
|
|
233
246
|
end
|
|
@@ -325,7 +338,7 @@ namespace :generate do
|
|
|
325
338
|
class <%= target %>SingletonTest < Test::Unit::TestCase
|
|
326
339
|
include TestHelper
|
|
327
340
|
|
|
328
|
-
# library "
|
|
341
|
+
# library "logger", "securerandom" # Declare library signatures to load
|
|
329
342
|
testing "singleton(::<%= target %>)"
|
|
330
343
|
|
|
331
344
|
<%- class_methods.each do |method_name, definition| -%>
|
|
@@ -344,7 +357,7 @@ namespace :generate do
|
|
|
344
357
|
class <%= target %>Test < Test::Unit::TestCase
|
|
345
358
|
include TestHelper
|
|
346
359
|
|
|
347
|
-
# library "
|
|
360
|
+
# library "logger", "securerandom" # Declare library signatures to load
|
|
348
361
|
testing "::<%= target %>"
|
|
349
362
|
|
|
350
363
|
<%- instance_methods.each do |method_name, definition| -%>
|
|
@@ -535,3 +548,17 @@ task :compile_c99 do
|
|
|
535
548
|
ensure
|
|
536
549
|
ENV.delete("TEST_NO_C23")
|
|
537
550
|
end
|
|
551
|
+
|
|
552
|
+
task :prepare_bench do
|
|
553
|
+
ENV.delete("DEBUG")
|
|
554
|
+
Rake::Task[:"clobber"].invoke
|
|
555
|
+
Rake::Task[:"templates"].invoke
|
|
556
|
+
Rake::Task[:"compile"].invoke
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
task :prepare_profiling do
|
|
560
|
+
ENV["DEBUG"] = "1"
|
|
561
|
+
Rake::Task[:"clobber"].invoke
|
|
562
|
+
Rake::Task[:"templates"].invoke
|
|
563
|
+
Rake::Task[:"compile"].invoke
|
|
564
|
+
end
|
data/config.yml
CHANGED
|
@@ -279,6 +279,8 @@ nodes:
|
|
|
279
279
|
c_type: rbs_keyword
|
|
280
280
|
- name: upper_bound
|
|
281
281
|
c_type: rbs_node
|
|
282
|
+
- name: lower_bound
|
|
283
|
+
c_type: rbs_node
|
|
282
284
|
- name: default_type
|
|
283
285
|
c_type: rbs_node
|
|
284
286
|
- name: unchecked
|
|
@@ -485,3 +487,47 @@ nodes:
|
|
|
485
487
|
c_type: rbs_node
|
|
486
488
|
- name: comment_location
|
|
487
489
|
c_type: rbs_location
|
|
490
|
+
- name: RBS::AST::Ruby::Annotations::TypeApplicationAnnotation
|
|
491
|
+
fields:
|
|
492
|
+
- name: prefix_location
|
|
493
|
+
c_type: rbs_location
|
|
494
|
+
- name: type_args
|
|
495
|
+
c_type: rbs_node_list
|
|
496
|
+
- name: close_bracket_location
|
|
497
|
+
c_type: rbs_location
|
|
498
|
+
- name: comma_locations
|
|
499
|
+
c_type: rbs_location_list
|
|
500
|
+
- name: RBS::AST::Ruby::Annotations::InstanceVariableAnnotation
|
|
501
|
+
fields:
|
|
502
|
+
- name: prefix_location
|
|
503
|
+
c_type: rbs_location
|
|
504
|
+
- name: ivar_name
|
|
505
|
+
c_type: rbs_ast_symbol
|
|
506
|
+
- name: ivar_name_location
|
|
507
|
+
c_type: rbs_location
|
|
508
|
+
- name: colon_location
|
|
509
|
+
c_type: rbs_location
|
|
510
|
+
- name: type
|
|
511
|
+
c_type: rbs_node
|
|
512
|
+
- name: comment_location
|
|
513
|
+
c_type: rbs_location
|
|
514
|
+
- name: RBS::AST::Ruby::Annotations::ClassAliasAnnotation
|
|
515
|
+
fields:
|
|
516
|
+
- name: prefix_location
|
|
517
|
+
c_type: rbs_location
|
|
518
|
+
- name: keyword_location
|
|
519
|
+
c_type: rbs_location
|
|
520
|
+
- name: type_name
|
|
521
|
+
c_type: rbs_type_name
|
|
522
|
+
- name: type_name_location
|
|
523
|
+
c_type: rbs_location
|
|
524
|
+
- name: RBS::AST::Ruby::Annotations::ModuleAliasAnnotation
|
|
525
|
+
fields:
|
|
526
|
+
- name: prefix_location
|
|
527
|
+
c_type: rbs_location
|
|
528
|
+
- name: keyword_location
|
|
529
|
+
c_type: rbs_location
|
|
530
|
+
- name: type_name
|
|
531
|
+
c_type: rbs_type_name
|
|
532
|
+
- name: type_name_location
|
|
533
|
+
c_type: rbs_location
|