Skip to content

Commit ec45215

Browse files
committed
Remove Sorbet typechecker
**What does this PR do?**: This PR is spiritually a revert of #1607, when we added the Sorbet typechecker to dd-trace-rb. It includes two commits: One where we remove all configuration and scaffolding surrounding Sorbet, and one where we remove all of the `# typed: ...` magic comments and `include Kernel` definitions added to make Sorbet happy. **Motivation**: As documented in #2641, the team has decided that the value vs pain equation for Sorbet has shifted in the past months, and thus that it was time to remove Sorbet. **Additional Notes**: Sorbet type checking in CI was actually removed earlier this week in #2617. **How to test the change?**: CI should still be green.
1 parent 484d0c1 commit ec45215

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5
-41397
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
gemfiles/**/* linguist-generated=true
2-
sorbet/rbi/**/* linguist-generated=true

.github/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ docs:
1010

1111
# Only test changes
1212
dev/testing:
13-
- all: [ '{spec/**,integration/**,benchmarks/**,sorbet/**}' ]
13+
- all: [ '{spec/**,integration/**,benchmarks/**}' ]
1414

1515
# Changes to Profiling
1616
profiling:

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,3 @@ gemfiles/.bundle
5151
# Native extension binaries
5252
lib/*.bundle
5353
lib/*.so
54-
55-
# Extra file kept by sorbet for debugging usage, as documented in https://sorbet.org/docs/adopting#step-6-source-control
56-
sorbet/rbi/hidden-definitions/errors.txt

Appraisals

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ REMOVED_GEMS = {
2525
:check => [
2626
'rbs',
2727
'steep',
28-
'spoom',
29-
'sorbet',
3028
],
3129
}
3230

Gemfile

-11
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,6 @@ if RUBY_PLATFORM != 'java'
112112
end
113113

114114
group :check do
115-
# For type checking
116-
# Sorbet releases almost daily, with new checks introduced that can make a
117-
# previously-passing codebase start failing. Thus, we need to lock to a specific
118-
# version and bump it from time to time.
119-
# Also, there's no support for windows
120-
if RUBY_VERSION >= '2.4.0' && (RUBY_PLATFORM =~ /^x86_64-(darwin|linux)/)
121-
gem 'sorbet', '= 0.5.10201'
122-
gem 'spoom', '~> 1.1'
123-
end
124-
125-
# type checking with steep
126115
if RUBY_VERSION >= '2.6.0' && RUBY_PLATFORM != 'java'
127116
gem 'rbs', '~> 2.8.1', require: false
128117
gem 'steep', '~> 1.3.0', require: false

Rakefile

+3-31
Original file line numberDiff line numberDiff line change
@@ -467,36 +467,8 @@ Rake::ExtensionTask.new("ddtrace_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFOR
467467
ext.ext_dir = 'ext/ddtrace_profiling_loader'
468468
end
469469

470-
desc 'Runs the sorbet type checker on the codebase'
471-
task :typecheck do
472-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0')
473-
$stderr.puts 'Sorry, cannot run sorbet type checker on older rubies :(' # rubocop:disable Style/StderrPuts
474-
else
475-
begin
476-
sh 'srb tc'
477-
rescue
478-
$stderr.puts( # rubocop:disable Style/StderrPuts
479-
%(
480-
+------------------------------------------------------------------------------+
481-
| **Hello there, fellow contributor who just triggered a Sorbet type error** |
482-
| |
483-
| We're still experimenting with Sorbet on this codebase. If possible, take a |
484-
| stab at getting it to work, but feel free to unblock yourself by adding |
485-
| a `# typed: false` or `# typed: ignore` comment at the top of files which |
486-
| Sorbet is struggling with. |
487-
| |
488-
| In particular, if you're adding a new integration, you'll need to use this |
489-
| mechanism as Sorbet does not play well with optional dependencies. |
490-
+------------------------------------------------------------------------------+
491-
)
492-
)
493-
raise
494-
end
495-
end
496-
end
497-
498-
desc 'Runs rubocop + type check + main test suite'
499-
task default: ['rubocop', 'typecheck', 'spec:main']
470+
desc 'Runs rubocop + main test suite'
471+
task default: ['rubocop', 'spec:main']
500472

501473
desc 'Runs the default task in parallel'
502-
multitask fastdefault: ['rubocop', 'typecheck', 'spec:main']
474+
multitask fastdefault: ['rubocop', 'spec:main']

docs/DevelopmentGuide.md

-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This guide covers some of the common how-tos and technical reference material fo
1010
- [Running tests](#running-tests)
1111
- [Checking code quality](#checking-code-quality)
1212
- [Running benchmarks](#running-benchmarks)
13-
- [Type checking](#type-checking)
1413
- [Appendix](#appendix)
1514
- [Writing new integrations](#writing-new-integrations)
1615
- [Custom transport adapters](#custom-transport-adapters)
@@ -164,19 +163,6 @@ $ bundle exec appraisal ruby-3.0.4-contrib rake spec:benchmark
164163

165164
Results are printed to STDOUT as well as written to the `./tmp/benchmark/` directory.
166165

167-
## Type checking
168-
169-
This library uses the [Sorbet](https://sorbet.org/) type checker. Sorbet can be run with `bundle exec srb tc` (or `bundle exec rake
170-
typecheck`). There's also Language Server Protocol support, if your editor supports it.
171-
172-
Type checking can be controlled on a file-by-file manner, using a `# typed: ...` comment. The default (when none is provided) is assuming `# typed: false`.
173-
174-
Things to note:
175-
176-
* For compatibility with older Rubies, we use Sorbet but do not yet allow type annotations in the codebase. If Sorbet is blocking you, feel free to use `# typed: false` or `# typed: ignore` with a quick note on why this was needed. In many cases, Sorbet can typecheck a file correctly with no extra type annotations.
177-
178-
* Most integration-specific code will reference optional external dependencies which Sorbet cannot see into. You'll probably need to use `# typed: false` or `# typed: ignore` for those files as well.
179-
180166
## Appendix
181167

182168
### Writing new integrations

sorbet/config

-7
This file was deleted.

sorbet/rbi/gems/addressable.rbi

-197
This file was deleted.

0 commit comments

Comments
 (0)