Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
309 commits
Select commit Hold shift + click to select a range
4236044
Bump minimatch from 3.0.4 to 3.0.5 in /vscode_extension (#6654)
dependabot[bot] Jan 11, 2023
a4a06f8
Resolver suggestions on export statements in package files cannot cro…
aadi-stripe Jan 11, 2023
8dacc47
Allow packages to specify their visibility (#5973)
aisamanra Jan 12, 2023
1204e68
Improve Sorbet runtime caller frame matching logic (#6664)
paracycle Jan 13, 2023
e9dcd0f
Add RBI for URI::WS (#6673)
Morriar Jan 20, 2023
b72ae85
fix typoes and wording in visibility docs/errors (#6677)
aisamanra Jan 24, 2023
6bd9ab6
Fix Type in Array#intersect? (#6678)
swiknaba Jan 24, 2023
382c9fb
Disable runtime type check in CustomType.scalar_type? (#6675)
georg-stripe Jan 24, 2023
3009286
Complain if comparing `String` and `Symbol` incorrectly (#6649)
jez Jan 24, 2023
f8835e7
Support setting `checked_tests` and `default_checked_level` via envir…
jeffcarbs Jan 24, 2023
d05afc0
Add docs for sorbet-runtime environment variables (#6679)
jeffcarbs Jan 25, 2023
0d47ece
Catch certain kinds of incorrect calls to `raise` (#6681)
jez Jan 25, 2023
c36ecd8
ignore tmp directory when generating config file (#6660)
salmanasiddiqui Jan 30, 2023
c7662d8
LSP fast path includes *all* relevant __package.rb files (#6685)
aadi-stripe Jan 30, 2023
33da02f
add tests for typing `Kernel#p` (#6663)
froydnj Jan 30, 2023
00186ca
fix `Kernel#p` tests given PR feedback (#6688)
froydnj Jan 30, 2023
8a5ce42
Revert checksums change after github is reverting on their end (#6689)
aadi-stripe Jan 31, 2023
7bf5823
Add signature for `Class#attached_object` method (#6690)
egiurleo Jan 31, 2023
efb72ed
Add `export_all!` to packages (#6647)
aisamanra Jan 31, 2023
37ff0e2
Update RBI for URI::WS (#6692)
KaanOzkan Jan 31, 2023
dcce158
Add some performance advice regarding type assertions to docs (#6686)
djudd Jan 31, 2023
1a0ee2e
Update Exception#initialize to accept any type (#6694)
KaanOzkan Feb 1, 2023
f44371a
Add HoverMultilineAssertion functionality (#6691)
bitwise-aiden Feb 1, 2023
0d85eaf
Stop crashing for type_member/type_template mismatch (#6683)
jez Feb 1, 2023
3878e42
Catch out-of-order constant references (#6671)
aadi-stripe Feb 2, 2023
5a46d2b
Backfill some T::Struct tests (#6696)
jeffcarbs Feb 2, 2023
97fabe1
don't reference count nesting scopes in resolver unnecessarily (#6706)
froydnj Feb 7, 2023
c750c75
Improve annotation for getch (#6707)
paddyobrien Feb 8, 2023
c302791
Incorrect Loc when using `:'...'` for symbols (#6341)
maruth-stripe Feb 8, 2023
2c701eb
delete `rules_rust` from dependencies (#6709)
froydnj Feb 8, 2023
4cc255a
Speed up move method by skipping incrementalResolve (#6710)
jez Feb 8, 2023
79dbc29
Remove a reundant arg from AbstractRenamer (#6711)
jez Feb 8, 2023
155f269
AbstractRenamer → AbstractRewriter (#6712)
jez Feb 8, 2023
9f47cfb
Save 8 bytes in SendResponse via FileRef (#6713)
jez Feb 9, 2023
be7b32a
Invalidate cache on autoloader_compatibility change (#6716)
bhang-stripe Feb 9, 2023
dcf1b06
stop doing unnecessary allocations during the `Initializer` rewriter …
froydnj Feb 10, 2023
44a0ee8
Add Pathname() sig (#6727)
dduugg Feb 13, 2023
58764f4
generics: Autocorrect to convert `X(...)` to `X[...]` (#6724)
jez Feb 13, 2023
ad2166e
Check bad override with optional keyword params (#6725)
jez Feb 13, 2023
4dd7dee
Move ENFORCE from LSP to resolver (#6700)
jez Feb 13, 2023
e4e51d3
Ruby treats `initialize` as private by default (#6720)
jez Feb 14, 2023
0574ee3
Allow covariant/contravariant generic classes (#6721)
jez Feb 14, 2023
d4f8fa8
reuse the computation of a prop's `:serialized_form` during prop addi…
froydnj Feb 14, 2023
4c811da
Upgrade to Ruby 2.7.7 (#6737)
jez Feb 15, 2023
c77e3a5
Add signature for GC.stat_heap (#6734)
gmcgibbon Feb 16, 2023
c1b50a7
Allow different type as fallback of `Array#fetch` (#6743)
jacobobq Feb 16, 2023
ed91b3f
add some test cases for `Array#fetch` (#6744)
froydnj Feb 16, 2023
f4e43c9
Allow `T.attached_class` as argument of bounded generic (#6738)
jez Feb 16, 2023
eb6bb54
add ruby 3 versions to `ruby-versions.txt` (#6746)
froydnj Feb 16, 2023
a4b75e3
Minor followups from #6720 (#6748)
jez Feb 17, 2023
7672e72
delete `sorbet_ruby_2_7_unpatched` from potential Ruby versions (#6750)
froydnj Feb 17, 2023
8afca51
fix export all (#6742)
aisamanra Feb 17, 2023
1a53a0a
runtime: Treat shapes/tuples as subtypes of Hash/Array (#6739)
jez Feb 17, 2023
9eadd9e
Update mode type on IO#initialize (#6751)
maxveldink Feb 17, 2023
ec02be8
special-case `T::Private::Types::SimplePairUnion` in some `T::Utils` …
froydnj Feb 21, 2023
526c387
Add "Copy Symbol to Clipboard" to the docs (#6761)
jez Feb 21, 2023
6833e8a
Runtime override checking should ignore type variables (#6754)
jez Feb 21, 2023
eaebdcd
Reject `T.attached_class` in modules (#6762)
jez Feb 22, 2023
048c9c3
Do not convert keyword args to hash if a block is present (#6753)
ilyailya Feb 22, 2023
f21c41c
Code action to promote instance method to singleton (#6714)
jez Feb 22, 2023
b9b1918
Fix crash in ivar assignment with begin/end (#6768)
jez Feb 22, 2023
e17514b
Call register_odd for better oj support (#6741)
jez Feb 22, 2023
4df6183
Provide direct link to https://sorbet.org/docs/self-type from error (…
gjtorikian Feb 23, 2023
5517676
Add RBIs for Regexp.timeout and Regexp.timeout= (#6773)
egiurleo Feb 24, 2023
4a0ff8d
Delete `<AttachedClass>` from module singleton classes (#6763)
jez Feb 25, 2023
05d4c9a
delete ruby 2.5-related TODO (#6786)
froydnj Feb 27, 2023
508c42a
Fix loc update issue on fast path for class/static field scopes (#6777)
aadi-stripe Feb 28, 2023
4d8a0b8
Fixed behaviour when a method does not exist to match the original (#…
meganemura Feb 28, 2023
2990e5a
Drive home the point that Sorbet erases generics (#6793)
jez Mar 1, 2023
118f6d5
Fix crash introduced by #6763 (#6792)
jez Mar 1, 2023
36ad4d8
Show all defs if class def'd multiple times but in RBIs (#6795)
jez Mar 1, 2023
6aa5842
Allow visible_to check to be skipped for certain allow-listed package…
aadi-stripe Mar 2, 2023
b163f8a
Output warning in LSP for untyped code (#6797)
maruth-stripe Mar 2, 2023
a5ac1ef
Revert "Output warning in LSP for untyped code (#6797)" (#6808)
jez Mar 3, 2023
af3d03c
Add settings for building ruby on linux-arm64 (#6813)
amytsai-stripe Mar 6, 2023
d3dbe06
`//tools/config:linux` → `@platforms//os:linux` (#6815)
jez Mar 6, 2023
d60b562
`config:linux` → `config:linux_x86_64` (#6816)
jez Mar 6, 2023
981d3cc
Do not call rename after move method refactoring (#6779)
ilyailya Mar 6, 2023
e4164e8
Fix typo in master (#6818)
jez Mar 6, 2023
a798452
`config:darwin` → `config:darwin_x86_64` (#6817)
jez Mar 6, 2023
d7c0a74
Format `-a` in cyan (#6799)
jez Mar 7, 2023
f153997
Boolean doesn't exist anymore (#6801)
jez Mar 7, 2023
2bf2fed
Skip calling into dispatchCall from type_syntax.cc (#6784)
jez Mar 7, 2023
7cdcd50
Revert "Delete `<AttachedClass>` from module singleton classes (#6763…
jez Mar 7, 2023
d402ccc
Change sig of GC.stat_heap to be Integer (#6829)
peterzhu2118 Mar 9, 2023
a51467c
Add capacity to String constructor (#6831)
fable-stripe Mar 9, 2023
0d0cb90
[Ruby3] Delete deprecated methods from RBIs (#6800)
ilyailya Mar 9, 2023
1681605
Remove redundant timers (#6836)
jez Mar 10, 2023
c0c914d
Add `types.input.rbi.bytes` counter (#6838)
jez Mar 10, 2023
dd4602e
Reduce Sorbet runtime retained memory by releasing location informati…
paracycle Mar 10, 2023
b6c4976
Improve Pathname sigs (#6846)
dduugg Mar 14, 2023
e4f5a24
Fix out-of-order reference check -- remove first-def-locs sharing & c…
aadi-stripe Mar 14, 2023
74089e6
Update bazel wrapper script to install bazel on linux-arm64 if needed…
amytsai-stripe Mar 14, 2023
2a7625a
Add SLOW_DEBUG_ONLY (#6840)
jez Mar 14, 2023
2695600
Fix FileUtils cp_r sig (#6847)
dduugg Mar 15, 2023
0b53c0b
Forcibly insert final newline in VS Code (#6850)
jez Mar 15, 2023
6d4515a
Factor Counters into //common/counters (#6826)
jez Mar 16, 2023
ff5a1f1
Update Hash#shift RBI (#6851)
bitwise-aiden Mar 16, 2023
bedf66e
Set type to `T.untyped` if constraint fails to solve (#6820)
jez Mar 16, 2023
60fb704
Add signature for Symbol#name (#6852)
andyw8 Mar 17, 2023
9dd33c0
Add Refinement RBI (#6856)
bitwise-aiden Mar 20, 2023
1573206
use x86-64 platforms for `@com_github_blake2_libb2` (#6861)
froydnj Mar 20, 2023
35e1460
Update RubyVM::AbstractSyntaxTree RBI for 3.2 changes (#6858)
bitwise-aiden Mar 20, 2023
6c26a7c
update `bazel-toolchain` fork with arm64 linux support (#6862)
froydnj Mar 20, 2023
bda3792
don't pass an explicit `--platforms` for `release-linux` config (#6863)
froydnj Mar 20, 2023
76cd43e
Update MatchData RBI for 3.2 changes (#6853)
bitwise-aiden Mar 20, 2023
4e6dd2f
Release memory after deduping (#6859)
jez Mar 20, 2023
d718719
update `build-static-release.sh` to account for multiple Linux archit…
froydnj Mar 20, 2023
55c1b83
Fix Pathname#binread return type (#6865)
dduugg Mar 20, 2023
df035f2
Remove debug breakpoint (#6769)
ilyailya Mar 21, 2023
0809885
Update String RBI for 3.2 changes (#6866)
bitwise-aiden Mar 21, 2023
97516ea
Remove two redundant Timer (#6872)
jez Mar 21, 2023
ab37b4f
Sprinkle some const in some places (#6871)
jez Mar 22, 2023
de0dfb2
Update Proc RBI for 3.2 changes (#6855)
bitwise-aiden Mar 22, 2023
8c3ff0d
Add support for Ruby 3.2 Data Class (#6760)
egiurleo Mar 23, 2023
e98c4bb
Update ttypes.rbi to support T::Types::TEnum (#6882)
cristian-rivera Mar 27, 2023
70697db
📝 Use monospace for referencing code in 5068 error docs (#6880)
marianosimone Mar 27, 2023
1ca5440
Fix typo in generics.md (#6834)
brent-stripe Mar 28, 2023
a1e8389
Add Kernel#callcc and Kernel#set_trace_func (#6881)
dduugg Mar 28, 2023
7692c93
Error when abstract class is initialized (#6273)
wildmaples Mar 29, 2023
a5d6e77
Add flagged logic in autoloader to onboard all non-legacy packages to…
aadi-stripe Mar 30, 2023
d1513bb
Remove --autogen-autoloader-pbal-non-annotated flag and enable PBAL f…
aadi-stripe Mar 31, 2023
5c8575c
Revert "Revert "Delete `<AttachedClass>` from module singleton classe…
jez Mar 31, 2023
0347b5f
Fix missing generics arity error (#6886)
jez Apr 1, 2023
5e0051d
Allow private interface methods (#6891)
jez Apr 3, 2023
8556f53
Use `--max-threads=0` in a newly-created CLI test (#6896)
jez Apr 3, 2023
a3de4ab
Fix error with jemalloc build on macOS (#6897)
jez Apr 3, 2023
44a11f3
Allow overriding an abstract method keeping it abstract (#6890)
jez Apr 3, 2023
c50ffb0
Misc fixes for docs (#6899)
neilparikh Apr 3, 2023
7808c69
Allow `T.attached_class` in modules (#6757)
jez Apr 5, 2023
54b8aa3
Fix fast path behavior when changing type_member variance (#6902)
jez Apr 6, 2023
4aa3036
Highlight untyped code in LSP / editors (#6824)
maruth-stripe Apr 6, 2023
57bda8f
Allow to cache frozen modules on Ruby 2.7+ (#6904)
casperisfine Apr 7, 2023
cf70023
Make T::Private::Types::Void a singleton (#6903)
casperisfine Apr 7, 2023
7d70e4f
Implement type pooling for `T::Types::TypedArray` (#6905)
casperisfine Apr 7, 2023
c5f28f8
Hide `<AttachedClass>` constants from autogen (#6909)
jez Apr 7, 2023
6434bbd
Update Module RBI for 3.2 changes (#6854)
bitwise-aiden Apr 7, 2023
839d6d1
Work around rubygems.org being flaky (#6907)
jez Apr 7, 2023
78e9ee4
Fix Opus::Command in `# typed: strong` (#6912)
jez Apr 8, 2023
3bc4a6d
Fix failing MethodPatch tests (#6870)
bitwise-aiden Apr 10, 2023
1aff67b
explicitly use one thread per core with ThinLTO (#6921)
amytsai-stripe Apr 10, 2023
8d72a60
Allow `prop` in `# typed: strong` files (#6913)
jez Apr 10, 2023
f205bf8
Skip making LoadYieldParams instruction if no block args (#6918)
jez Apr 10, 2023
15bbec7
Tighten up block return loc (#6915)
jez Apr 10, 2023
f5b5a18
Add the self parameter for `instance_eval` on `BasicObject` (#6914)
maruth-stripe Apr 11, 2023
cd2f6f8
Revert "Add the self parameter for `instance_eval` on `BasicObject` (…
jez Apr 11, 2023
5770bd6
More targeted `# typed: strong` errors (#6908)
jez Apr 11, 2023
7b7f14c
Add new section: how to add default method to interface (#6924)
jez Apr 11, 2023
9864768
Fix typo in error-reference (#6925)
jez Apr 11, 2023
1d6e762
Annotate `Ripper::PARSER_EVENT_TABLE` and `Ripper::SCANNER_EVENT_TABL…
prikha Apr 12, 2023
1889031
More backoff for rubygems publish (#6931)
jez Apr 12, 2023
8dc3955
Upgrade prettier in website (#6933)
jez Apr 13, 2023
f57ad22
add some more exception-handling test cases (#6936)
froydnj Apr 13, 2023
b86899a
restructure `updateKnowledge` with early returns (#6935)
froydnj Apr 13, 2023
bab322a
Fix return type of String#squeeze! (#6920)
iownthegame Apr 13, 2023
792efb6
Allow --suggest-unsafe to suggest all-untyped sigs (#6932)
jez Apr 13, 2023
51a2e9e
Add some more docs (#6934)
jez Apr 13, 2023
77993bf
noop: Compute file table after typecheck, not after resolve (#6941)
jez Apr 14, 2023
4934474
Fix docs for 4002 (#6942)
jez Apr 14, 2023
67c657a
Implement `T.anything`, Sorbet's top type (#6917)
jez Apr 14, 2023
6e88a78
Skip autoload generation in autogen when only path-based-autoloading-…
aadi-stripe Apr 17, 2023
3553d97
Make sigs for `String#encode` Ruby 3 compatible (#6948)
ilyailya Apr 17, 2023
3734c65
Add RBI sigs for JSON.load_file & JSON.load_file! (#6940)
sambostock Apr 18, 2023
de5643b
Don't suggest `T.untyped` by default (#6943)
jez Apr 18, 2023
4f93e19
Update CSV's RBI to be Ruby 3 compatible (#6950)
ilyailya Apr 18, 2023
a333333
Track untyped usages by file (#6919)
jez Apr 18, 2023
db8ed0d
Add `pkg` to file-table-export (#6945)
jez Apr 18, 2023
2b16ee7
Start to bring the parser up-to-date with Ruby 3.2 (#6877)
egiurleo Apr 20, 2023
e2b7107
Remove `bind` from `T.proc` when in Initializer rewriter (#6949)
pl-at-shopify Apr 20, 2023
e74903e
Support Ruby 3.2 forwarded rest and keyword rest args (#6910)
egiurleo Apr 20, 2023
371980e
Add some more T.untyped docs (#6954)
jez Apr 22, 2023
498b551
Remove `bind` from `T.proc` follow-up with tests (#6955)
pl-at-shopify Apr 24, 2023
7307292
Kernel#send: BasicObject -> T.anything (#6960)
jez Apr 26, 2023
f209e00
Add editForDSLMethod helper (#6958)
jez Apr 28, 2023
6a9e320
Don't build sorbet_ruby on test-static-sanitized (#6964)
jez Apr 28, 2023
a261f1b
Add some more recipes to the lmdb docs (#6966)
jez Apr 29, 2023
a19996d
Use reveal_type in `self.class` test (#6971)
jez May 1, 2023
d1cf415
Only run prop sensitivity handler when rule is present (#6967)
aadi-stripe May 1, 2023
687cdf1
Migrate a prop type validation helper from kwarg -> arg so that it ca…
aadi-stripe May 2, 2023
13e43b8
Use isLegacyStdlibGeneric helper (#6970)
jez May 3, 2023
0651da2
Remove unnecessary allocations when checking splat arguments (#6969)
aadi-stripe May 4, 2023
774031a
More disabling sig-checking in props, and other fixes (#6979)
aadi-stripe May 5, 2023
99ca900
Add the class name to prop definition error (#6980)
neilparikh May 7, 2023
02259c6
Hide "call to [] on T.untyped" error for lambdas (#6981)
jez May 8, 2023
c6c4001
Bump bundler version in sorbet_ruby (#6900)
aisamanra May 8, 2023
d786ef7
Add missing RBI for `URI.encode_uri_component` (#6986)
sambostock May 8, 2023
523c6e5
Revert "Bump bundler version in sorbet_ruby (#6900)" (#6989)
aisamanra May 8, 2023
2d8908e
Use `new`, not `initialize`, to enforce runtime abstract (#6888)
jez May 9, 2023
ece6ed9
optimize allocations during sig running (#6991)
froydnj May 9, 2023
3120180
Only swap if absolutely required (#6791)
jez May 9, 2023
80acfd8
don't allocate hashes for zero-{type ,}parameter functions (#6794)
froydnj May 9, 2023
dd8fe91
more signature allocation optimizations (#6994)
froydnj May 10, 2023
b0d74d5
sorbet-runtime: only materialize some arrays when needed (#6993)
maruth-stripe May 10, 2023
512885e
add rudimentary sig benchmark (#6998)
froydnj May 10, 2023
83cd099
Fix signature for Kernel.raise (#6982)
iMacTia May 10, 2023
352ea35
Bump Bundler version to 2.3.3 (#6995)
aisamanra May 11, 2023
85808d2
Revert "Bump Bundler version to 2.3.3 (#6995)" (#7000)
aisamanra May 11, 2023
d94b3e0
Make `Class` generic in its attached class (#6781)
jez May 11, 2023
2e3775c
Revert "Revert "Bump Bundler version to 2.3.3 (#6995)" (#7000)" (#7001)
aisamanra May 12, 2023
b9a7f92
Replace Singleton rewriter with has_attached_class! (#7002)
jez May 12, 2023
6c7ce23
Update `Enumerable#tally` sig for Ruby 3.1 (#6999)
amomchilov May 12, 2023
4844b97
Revert "Revert "Revert "Bump Bundler version to 2.3.3 (#6995)" (#7000…
aisamanra May 12, 2023
cfadd47
cache `T.type_parameter` return values for the same typename (#7007)
froydnj May 12, 2023
50d2db0
Improve `Object_class` intrinsic using T::Class (#6988)
jez May 12, 2023
2c81638
Autocorrect e -> T.must(e) for T.let(e, U) where e: S with S = T.nila…
maruth-stripe May 15, 2023
34848ba
Remove Array#+ -> Array#concat autocorrect (#7014)
jez May 16, 2023
ac24785
runtime: Fix problem with covariant T::Hash/Object (#7018)
jez May 16, 2023
bc3b1bb
Widen type of `Array#+` (#7015)
jez May 16, 2023
6c6e4f1
Use valid syntax for `T.attached_class` in suggseted sig (#7021)
jez May 17, 2023
c3ba8c0
Make bare `Class` an error (#6983)
jez May 17, 2023
17899e6
Call real `method` in abstract! (#7019)
jez May 18, 2023
4f9ebc0
Create applied types for type in sealed_subclasses (#7020)
jez May 18, 2023
a26ec49
Delete SelfNew (#6978)
jez May 19, 2023
e4621dc
Restore performance of recording sealed subclasses (#7029)
jez May 19, 2023
a7cdaa9
Register `class` intrinsic on `Kernel` (#7030)
jez May 19, 2023
8f1b911
Revert "Revert "Revert "Revert "Bump Bundler version to 2.3.3 (#6995)…
aisamanra May 22, 2023
0312714
Revert "Register `class` intrinsic on `Kernel` (#7030)" (#7034)
jez May 22, 2023
0953aee
Change how we print T.class_of types (#7032)
jez May 22, 2023
f7b1eaf
Add option to output blames for `T.untyped` usages in a JSON file (#7…
maruth-stripe May 23, 2023
a787deb
Add code action to delete T.unsafe (#7036)
jez May 24, 2023
5b06448
Show Sorbet actions in a dropdown (#7042)
damolina-stripe May 24, 2023
d6eaa90
Remove all autoload generation in autogen (#7040)
aadi-stripe May 25, 2023
84a87c2
Fix: Restore "sorbet.configure" command Id (#7044)
damolina-stripe May 25, 2023
15961ee
Update community.js with useful Sorbet gem links (#6947)
maxveldink May 26, 2023
0b99bb6
Force the first argument to `Time.new` to be `Integer` (#7045)
aisamanra May 26, 2023
1aef8f4
Refactor logic into specific-purpose components (#7046)
damolina-stripe May 30, 2023
4688597
use `case` rather than chained if-else in call validation (#7049)
froydnj May 30, 2023
754ecd7
Settings should use `mardownDescription` when using markdown. (#7051)
damolina-stripe May 30, 2023
3eaecd5
Change highlight loc of untyped call site (#7047)
jez May 30, 2023
64f1d3f
Refactor extension logic into purpose-specific components (part 2) (#…
damolina-stripe May 31, 2023
5a01b52
Add test for align base type args (#7054)
jez May 31, 2023
a8f0b3c
Remove runtime lodash dependency (#7056)
damolina-stripe May 31, 2023
727ccf4
Add sig for `Symbol#===` (#7041)
jez May 31, 2023
3b80174
Align telemetry code with internal implementation (#7055)
damolina-stripe May 31, 2023
b496f45
Report single error when a constant alias fails to resolve (#7031)
jez May 31, 2023
302ea09
Two pre-work changes for T.class_of (#7057)
jez May 31, 2023
904b540
prework: Some more code movement for T.class_of (#7058)
jez May 31, 2023
893f573
Fix Command Enablement Rules (#7061)
damolina-stripe Jun 1, 2023
cfe4830
Extension code uses a `_` prefix to denote private fields and methods…
damolina-stripe Jun 2, 2023
dadeaf8
Fix Command Enablement Rules (2) (#7062)
damolina-stripe Jun 2, 2023
6df47cf
Structure extension logging (#7066)
damolina-stripe Jun 3, 2023
6cfdcc5
Add a test showing how Result#and_then can be implemented (#7070)
jez Jun 5, 2023
ca193f7
Add tests for `log` and `SetLogLevel`. (#7069)
damolina-stripe Jun 6, 2023
10bd8e5
updated_prop: `DeprecatedNumeric` → `Numeric` (#7071)
jez Jun 6, 2023
5fc8f19
Remove mentions of Chalk::ODM from Sorbet (#7072)
jez Jun 6, 2023
0f6fd90
Delete useless test (#7075)
jez Jun 6, 2023
e29a111
chore: Merge upstream master into scip-ruby/master.
varungandhi-src Jun 7, 2023
0c65174
fix: Compilation errors & update snapshots
varungandhi-src Jun 7, 2023
e94c8ef
test: Update snapshot for regression for Singletons
varungandhi-src Jun 7, 2023
c4a8b28
style: Fix formatting
varungandhi-src Jun 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 17 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ test:coverage --spawn_strategy=local
build --define=versioned=false
build:versioned --workspace_status_command=tools/buildstamp/get_workspace_status --stamp --define=versioned=true

build:dbg-darwin --config=dbg --platforms=@//tools/config:darwin_x86_64
build:dbg-linux --config=dbg --platforms=@//tools/config:linux_x86_64
build:dbg-darwin --config=dbg --platforms=@//tools/platforms:darwin_x86_64
build:dbg-linux --config=dbg --platforms=@//tools/platforms:linux_x86_64

##
## Configurations used for releases
Expand All @@ -94,9 +94,19 @@ build:release-debug-common --config=forcedebug
build:release-debug-common --config=debugsymbols
build:release-debug-common --config=skipslowenforce

# This mode has been added to allow tracking the symbols
# which are to blame for usages of untyped code in a codebase.
# This allows identifying what symbols would be the highest impact
# to type.
#
# Earlier, we allowed for such statistic collection only in DEBUG mode
# However, that was far too slow for our purposes. Thus, this mode allows
# you to build in release mode and track these statistics.
build:untyped-blame --copt=-DTRACK_UNTYPED_BLAME_MODE

# harden: mark relocation sections read-only
build:release-linux --linkopt=-Wl,-z,relro,-z,now
build:release-linux --config=lto-linux --config=release-common --platforms=@//tools/config:linux_x86_64
build:release-linux --config=lto-linux --config=release-common

# This is to turn on vector instructions where available.
# We used to do this unconditionally, but Rosetta 2 doesn't translate all vector instructions well.
Expand All @@ -109,7 +119,7 @@ build:release-linux --config=lto-linux --config=release-common --platforms=@//to
build:release-linux --copt=-march=sandybridge
build:release-sanitized-linux --copt=-march=sandybridge

build:release-mac --config=release-common --platforms=@//tools/config:darwin_x86_64
build:release-mac --config=release-common --platforms=@//tools/platforms:darwin_x86_64

build:release-debug-linux --config=release-linux
build:release-debug-linux --config=release-debug-common
Expand Down Expand Up @@ -170,6 +180,9 @@ build:lto --config=static-libs

## flags that substantially increase Clang&LLVMs ability to devirtualize calls
build:lto-linux --linkopt=-Wl,--icf=all

# Improves linking time on arm64 hosts
build:lto-linux --linkopt=-Wl,--thinlto-jobs=all
build:lto-linux --config=lto

# By default, we make static builds, but we can also use dynamic linking if asked to.
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ jobs:
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v3
- name: Format Bazel files
run: |
./tools/scripts/format_build_files.sh
if ! git diff --quiet; then
git diff
echo ""
echo "-----------------------------------------------------"
echo "Re-run ./tools/scripts/format_build_files.sh and push"
echo "-----------------------------------------------------"
exit 1
fi
- uses: actions/setup-go@v3
with:
go-version: '>=1.19'
- name: Format Bazel files
run: |
set -e
GOBIN="$PWD" go install github.com/bazelbuild/buildtools/buildifier@latest
git ls-files -- '**.bzl' '**/BUILD' WORKSPACE | xargs ./buildifier -mode=diff
- name: Lint workflow files
run: |
go install github.com/rhysd/actionlint/cmd/actionlint@latest
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
2.7.7
15 changes: 13 additions & 2 deletions .sorbet-buildkite/build-sorbet-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pushd gems/sorbet-runtime
echo "--- setup :ruby:"
eval "$(rbenv init -)"

runtime_versions=(2.7.2 3.1.2)
runtime_versions=(2.7.7 3.1.2)

for runtime_version in "${runtime_versions[@]}"; do
rbenv install --skip-existing "$runtime_version"
Expand All @@ -23,7 +23,7 @@ for runtime_version in "${runtime_versions[@]}"; do

failed=

if [ "$runtime_version" = "2.7.2" ]; then
if [ "$runtime_version" = "2.7.7" ]; then
# Our Rubocop version doesn't understand Ruby 3.1 as a valid Ruby version
echo "+++ rubocop ($runtime_version)"
if ! rbenv exec bundle exec rake rubocop; then
Expand All @@ -36,6 +36,17 @@ for runtime_version in "${runtime_versions[@]}"; do
failed=1
fi

pushd test/wholesome

rbenv exec bundle config set path 'vendor/bundle'
rbenv exec bundle install

if ! rbenv exec bundle exec rake test; then
failed=1
fi

popd

if [ "$failed" != "" ]; then
exit 1
fi
Expand Down
36 changes: 20 additions & 16 deletions .sorbet-buildkite/build-static-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ set -euo pipefail
export JOB_NAME=build-static-release
source .buildkite/tools/setup-bazel.sh

unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) platform="linux";;
Darwin*) platform="mac";;
*) exit 1
kernel_name="$(uname -s | tr 'A-Z' 'a-z')"
processor_name="$(uname -m)"

platform="${kernel_name}-${processor_name}"
case "$platform" in
linux-x86_64|linux-aarch64)
CONFIG_OPTS="--config=release-linux"
;;
darwin-x86_64|darwin-arm64)
CONFIG_OPTS="--config=release-mac"
command -v autoconf >/dev/null 2>&1 || brew install autoconf
;;
*)
echo >&2 "Building on $platform is not implemented"
exit 1
;;
esac

if [[ "linux" == "$platform" ]]; then
CONFIG_OPTS="--config=release-linux"
elif [[ "mac" == "$platform" ]]; then
CONFIG_OPTS="--config=release-mac"
command -v autoconf >/dev/null 2>&1 || brew install autoconf
fi

echo will run with $CONFIG_OPTS

./bazel build //main:sorbet --strip=always $CONFIG_OPTS
Expand All @@ -32,7 +36,7 @@ pushd gems/sorbet-static
git_commit_count=$(git rev-list --count HEAD)
release_version="0.5.${git_commit_count}"
sed -i.bak "s/0\\.0\\.0/${release_version}/" sorbet-static.gemspec
if [[ "mac" == "$platform" ]]; then
if [[ "darwin" == "$kernel_name" ]]; then
# Our binary should work on almost all OSes. The oldest v8 publishes is -14
# so I'm going with that for now.
for i in {14..22}; do
Expand Down Expand Up @@ -70,11 +74,11 @@ rbenv exec gem uninstall --all --executables --ignore-dependencies minitest moch
rbenv exec gem uninstall --all --executables --ignore-dependencies sorbet sorbet-static
trap 'rbenv exec gem uninstall --all --executables --ignore-dependencies sorbet sorbet-static' EXIT

if [[ "mac" == "$platform" ]]; then
if [[ "darwin" == "$kernel_name" ]]; then
gem_platform="$(ruby -e "(platform = Gem::Platform.local).cpu = 'universal'; puts(platform.to_s)")"
rbenv exec gem install ../../gems/sorbet-static/sorbet-static-*-"$gem_platform".gem
else
rbenv exec gem install ../../gems/sorbet-static/sorbet-static-*-x86_64-linux.gem
rbenv exec gem install ../../gems/sorbet-static/sorbet-static-*-"$processor_name"-linux.gem
fi
rbenv exec gem install sorbet-*.gem

Expand Down Expand Up @@ -104,7 +108,7 @@ rm -rf _out_
mkdir -p _out_/gems

mv gems/sorbet-static/sorbet-static-*.gem _out_/gems/
if [[ "linux" == "$platform" ]]; then
if [[ "$kernel_name" == "linux" ]]; then
mv gems/sorbet/sorbet*.gem _out_/gems/
fi

Expand Down
66 changes: 36 additions & 30 deletions .sorbet-buildkite/publish-ruby-gems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,52 @@ source .buildkite/tools/with_backoff.sh

rbenv install --skip-existing

publish_sorbet_static_gem() {
gem_archive=$1
platform=$2

if gem list --remote rubygems.org --exact 'sorbet-static' | grep -q "${release_version}[^,]*${platform}"; then
echo "$gem_archive already published."
return
fi

# This is last so the exit code is used as the status code for with_backoff
gem push --verbose "$gem_archive"
}

# Push the sorbet-static gems first, in case they fail. We don't want to end
# up in a weird state where 'sorbet' requires a pinned version of
# sorbet-static, but the sorbet-static gem push failed.
#
# (By failure here, we mean that RubyGems.org 502'd for some reason.)
for gem_archive in "_out_/gems/sorbet-static-$release_version"-*.gem; do
echo "Attempting to publish $gem_archive"
if [[ "$gem_archive" =~ _out_/gems/sorbet-static-([^-]*)-([^.]*).gem ]]; then
platform="${BASH_REMATCH[2]}"
if ! gem list --remote rubygems.org --exact 'sorbet-static' | grep -q "${release_version}[^,]*${platform}"; then
with_backoff gem push --verbose "$gem_archive"
else
echo "$gem_archive already published."
fi
else
if ! [[ "$gem_archive" =~ _out_/gems/sorbet-static-([^-]*)-([^.]*).gem ]]; then
echo "Regex match failed. This should never happen."
exit 1
fi

platform="${BASH_REMATCH[2]}"

echo "Attempting to publish $gem_archive"
with_backoff publish_sorbet_static_gem "$gem_archive" "$platform"
done

gem_archive="_out_/gems/sorbet-runtime-$release_version.gem"
echo "Attempting to publish $gem_archive"
if ! gem list --remote rubygems.org --exact 'sorbet-runtime' | grep -q "$release_version"; then
with_backoff gem push --verbose "$gem_archive"
else
echo "$gem_archive already published."
fi
# Sometimes the 'gem push' times out, but after the connection dies, the server
# decides to finish publishing the gem. So we have to interleave 'gem list' and
# 'gem push' calls--it's not enough to just check whether it exists once.
publish_gem() {
gem_name=$1
gem_archive="_out_/gems/$gem_name-$release_version.gem"

gem_archive="_out_/gems/sorbet-$release_version.gem"
echo "Attempting to publish $gem_archive"
if ! gem list --remote rubygems.org --exact 'sorbet' | grep -q "$release_version"; then
with_backoff gem push --verbose "$gem_archive"
else
echo "$gem_archive already published."
fi
if gem list --remote rubygems.org --exact "$gem_name" | grep -q "$release_version"; then
echo "$gem_archive already published."
return
fi

gem_archive="_out_/gems/sorbet-static-and-runtime-$release_version.gem"
echo "Attempting to publish $gem_archive"
if ! gem list --remote rubygems.org --exact 'sorbet-static-and-runtime' | grep -q "$release_version"; then
with_backoff gem push --verbose "$gem_archive"
else
echo "$gem_archive already published."
fi
# This is last so the exit code is used as the status code for with_backoff
gem push --verbose "$gem_archive"
}

with_backoff publish_gem "sorbet-runtime"
with_backoff publish_gem "sorbet"
with_backoff publish_gem "sorbet-static-and-runtime"
5 changes: 5 additions & 0 deletions .sorbet-buildkite/test-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ case "${unameOut}" in
esac

if [[ "linux" == "$platform" ]]; then
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
apt-get update
apt-get install -yy libncurses5-dev libncursesw5-dev xxd
elif [[ "mac" == "$platform" ]]; then
Expand Down Expand Up @@ -38,6 +39,10 @@ mkdir -p _out_
test_args=(
"//test:compiler"
"//test/cli/compiler"
# These are two tests that depend on sorbet_ruby, and it's annoying to have
# to build sorbet_ruby on the static sanitized job (delays test start time)
"//test:end_to_end_rbi_test"
"//test:single_package_runner"
"-c"
"opt"
"--config=forcedebug"
Expand Down
1 change: 1 addition & 0 deletions .sorbet-buildkite/test-vscode-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euo pipefail

# TODO: We probably want to move this into https://github.com/sorbet/sorbet-build-image eventually

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
apt-get update
apt-get install -y libxshmfence-dev libnss3-dev libatk1.0-0 libatk-bridge2.0-0 \
libdrm2 xvfb libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 libasound2
Expand Down
2 changes: 1 addition & 1 deletion .sorbet-buildkite/tools/with_backoff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "--- Loading with_backoff helper"

# https://stackoverflow.com/a/8351489
with_backoff() {
local attempts=5
local attempts=8
local timeout=1 # doubles each failure

local attempt=0
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"files.insertFinalNewline": true,
"editor.renderFinalNewline": "off",
"editor.insertSpaces": true,
"editor.rulers": [120],
// Clangd 9.0 has a new semantic highlighting feature, but it's buggy and causes
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Otherwise, add this line to your `Gemfile`:
```ruby
gem 'scip-ruby', require: false, :group => :development
```

After either of those steps, run `bundle install`
to download and install fetch `scip-ruby`.

Expand Down
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ BAZEL_VERSION = "5.2.0"

BAZEL_INSTALLER_VERSION_LINUX_X86_64_SHA = "7d9ef51beab5726c55725fb36675c6fed0518576d3ba51fb4067580ddf7627c4"

BAZEL_INSTALLER_VERSION_LINUX_ARM64_SHA = "ae50cb7d64aebee986287134ff8ca0335651a0c1685348b3216f3fdfa20ff7e7"

BAZEL_INSTALLER_VERSION_DARWIN_X86_64_SHA = "645e7c335efc3207905e98f0c56a598b7cb0282d54d9470e80f38fb698064fb3"

BAZEL_INSTALLER_VERSION_DARWIN_ARM64_SHA = "bc018ee7980cdf1c3f0099ec1568847a1756a3c00f1f9440bca44c26ceb3d90f"
4 changes: 3 additions & 1 deletion ast/Helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ bool definesBehavior(const ExpressionPtr &expr) {
},

[&](const ast::Assign &asgn) {
if (ast::isa_tree<ast::ConstantLit>(asgn.lhs)) {
// this check can fire before the namer converts lhs constants in assignments from UnresolvedConstantLit ->
// ConstantLit, so we have to allow for both types.
if (ast::isa_tree<ast::ConstantLit>(asgn.lhs) || ast::isa_tree<ast::UnresolvedConstantLit>(asgn.lhs)) {
result = false;
} else {
result = true;
Expand Down
24 changes: 14 additions & 10 deletions ast/Helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ class MK {
std::move(type));
}

static ExpressionPtr AssumeType(core::LocOffsets loc, ExpressionPtr value, ExpressionPtr type) {
return ast::make_expression<ast::Cast>(loc, core::Types::todo(), std::move(value), core::Names::assumeType(),
std::move(type));
}

static ExpressionPtr ClassOf(core::LocOffsets loc, ExpressionPtr value) {
return Send1(loc, T(loc), core::Names::classOf(), loc, std::move(value));
}
Expand Down Expand Up @@ -426,11 +431,6 @@ class MK {
return Constant(loc, core::Symbols::Magic());
}

static ExpressionPtr SelfNew(core::LocOffsets loc, core::LocOffsets funLoc, int numPosArgs,
ast::Send::ARGS_store args, Send::Flags flags = {}) {
return Send(loc, Magic(loc), core::Names::selfNew(), funLoc, numPosArgs, std::move(args), flags);
}

static ExpressionPtr DefineTopClassOrModule(core::LocOffsets loc, core::ClassOrModuleRef klass) {
Send::Flags flags;
flags.isRewriterSynthesized = true;
Expand All @@ -452,6 +452,14 @@ class MK {
return ret;
}

static ExpressionPtr RaiseTypedUnimplemented(core::LocOffsets loc) {
auto kernel = Constant(loc, core::Symbols::Kernel());
auto msg = String(loc, core::Names::rewriterRaiseUnimplemented());
auto ret = Send1(loc, std::move(kernel), core::Names::raise(), loc, std::move(msg));
cast_tree<ast::Send>(ret)->flags.isRewriterSynthesized = true;
return ret;
}

static bool isRootScope(const ast::ExpressionPtr &scope) {
if (ast::isa_tree<ast::EmptyTree>(scope)) {
return true;
Expand All @@ -469,11 +477,7 @@ class MK {
}

static bool isSelfNew(ast::Send *send) {
if (send->fun != core::Names::selfNew()) {
return false;
}

return isMagicClass(send->recv);
return send->fun == core::Names::new_() && send->recv.isSelfReference();
}

static core::NameRef arg2Name(const ExpressionPtr &arg) {
Expand Down
Loading