tapioca 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/README.md +182 -36
  4. data/lib/tapioca/cli.rb +122 -65
  5. data/lib/tapioca/commands/annotations.rb +165 -33
  6. data/lib/tapioca/commands/check_shims.rb +91 -0
  7. data/lib/tapioca/commands/{init.rb → configure.rb} +1 -1
  8. data/lib/tapioca/commands/dsl.rb +1 -1
  9. data/lib/tapioca/commands/gem.rb +5 -5
  10. data/lib/tapioca/commands.rb +2 -1
  11. data/lib/tapioca/dsl/compiler.rb +1 -13
  12. data/lib/tapioca/dsl/compilers/active_model_attributes.rb +1 -1
  13. data/lib/tapioca/dsl/compilers/active_record_relations.rb +17 -0
  14. data/lib/tapioca/dsl/compilers/active_record_typed_store.rb +5 -4
  15. data/lib/tapioca/dsl/compilers/protobuf.rb +6 -0
  16. data/lib/tapioca/dsl/compilers.rb +0 -4
  17. data/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb +2 -2
  18. data/lib/tapioca/dsl/pipeline.rb +0 -2
  19. data/lib/tapioca/dsl.rb +8 -0
  20. data/lib/tapioca/executor.rb +0 -3
  21. data/lib/tapioca/gem/events.rb +16 -2
  22. data/lib/tapioca/gem/listeners/base.rb +11 -0
  23. data/lib/tapioca/gem/listeners/dynamic_mixins.rb +5 -0
  24. data/lib/tapioca/gem/listeners/foreign_constants.rb +65 -0
  25. data/lib/tapioca/gem/listeners/methods.rb +6 -17
  26. data/lib/tapioca/gem/listeners/mixins.rb +31 -10
  27. data/lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb +5 -0
  28. data/lib/tapioca/gem/listeners/sorbet_enums.rb +5 -0
  29. data/lib/tapioca/gem/listeners/sorbet_helpers.rb +5 -0
  30. data/lib/tapioca/gem/listeners/sorbet_props.rb +5 -0
  31. data/lib/tapioca/gem/listeners/sorbet_required_ancestors.rb +5 -0
  32. data/lib/tapioca/gem/listeners/sorbet_signatures.rb +6 -1
  33. data/lib/tapioca/gem/listeners/sorbet_type_variables.rb +5 -0
  34. data/lib/tapioca/gem/listeners/subconstants.rb +5 -0
  35. data/lib/tapioca/gem/listeners/yard_doc.rb +5 -0
  36. data/lib/tapioca/gem/listeners.rb +1 -0
  37. data/lib/tapioca/gem/pipeline.rb +58 -15
  38. data/lib/tapioca/gem.rb +6 -0
  39. data/lib/tapioca/gemfile.rb +7 -6
  40. data/lib/tapioca/helpers/cli_helper.rb +8 -2
  41. data/lib/tapioca/helpers/config_helper.rb +0 -2
  42. data/lib/tapioca/helpers/env_helper.rb +16 -0
  43. data/lib/tapioca/helpers/rbi_files_helper.rb +252 -0
  44. data/lib/tapioca/helpers/rbi_helper.rb +74 -94
  45. data/lib/tapioca/helpers/sorbet_helper.rb +2 -3
  46. data/lib/tapioca/helpers/test/content.rb +0 -2
  47. data/lib/tapioca/helpers/test/template.rb +0 -2
  48. data/lib/tapioca/internal.rb +34 -12
  49. data/lib/tapioca/rbi_ext/model.rb +2 -15
  50. data/lib/tapioca/runtime/dynamic_mixin_compiler.rb +18 -16
  51. data/lib/tapioca/runtime/reflection.rb +27 -0
  52. data/lib/tapioca/runtime/trackers/constant_definition.rb +17 -7
  53. data/lib/tapioca/runtime/trackers/mixin.rb +49 -14
  54. data/lib/tapioca/sorbet_ext/generic_name_patch.rb +1 -4
  55. data/lib/tapioca/static/requires_compiler.rb +0 -2
  56. data/lib/tapioca/static/symbol_loader.rb +26 -30
  57. data/lib/tapioca/static/symbol_table_parser.rb +0 -3
  58. data/lib/tapioca/version.rb +1 -1
  59. data/lib/tapioca.rb +3 -0
  60. metadata +22 -7
  61. data/lib/tapioca/dsl/helpers/param_helper.rb +0 -55
  62. data/lib/tapioca/helpers/shims_helper.rb +0 -115
  63. data/lib/tapioca/helpers/signatures_helper.rb +0 -17
  64. data/lib/tapioca/helpers/type_variable_helper.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb8747fff200d370504c4ae3119ab567335b4dc6b02a163a50217084a66bbe0d
4
- data.tar.gz: 551715f2806d1038d4ed4d7ac9f23e7ca31051a8db153cf854878ad1aa529510
3
+ metadata.gz: 590bba5b82c68fea817819ca7d749a8527cc74915df1989639d6b9a23792f4ac
4
+ data.tar.gz: 1209c829aca470f50a86db985e3764827c679fca90c312f39daac81b3389d196
5
5
  SHA512:
6
- metadata.gz: 1a854413aaaa4f50464fd5be89cfd5de4770f9468a70627e8af556d2c953a0b1e4f86901a1907bebf8f367c2d94429bd52fe38ae977797582e1bf2e35432f00b
7
- data.tar.gz: 00671d2d35d2e40fd7f2761c7e7b4994bb88b051311520b042fc950c0f1ce8c62017a8e79605f4397819f2233cb5c4342fe03f8f65b39c3fd25ca71e56a31db1
6
+ metadata.gz: 151fb7e27e03ffaab3a9f7723333154bff8b773d5d98c24e048c726966a2e8c37ea59781d9fc2d445e2b0dd98bbb932461ad525aeb262b97ff56468da693e515
7
+ data.tar.gz: 81e6a1f2f25ccd489ae50076a3b07082e53cf279375d5dbd5219916591a3c49b743bc022aea97cef5ff7f88fe919e2d5d1a632892a8596fcb5e888032096e7de
data/Gemfile CHANGED
@@ -11,7 +11,6 @@ gem("pry-byebug")
11
11
  gem("rubocop-shopify", require: false)
12
12
  gem("rubocop-sorbet", ">= 0.4.1")
13
13
  gem("rubocop-rspec", require: false)
14
- gem("sorbet")
15
14
  gem("ruby-lsp", require: false)
16
15
 
17
16
  group(:deployment, :development) do
@@ -38,7 +37,7 @@ group(:development, :test) do
38
37
  gem("shopify-money", require: false)
39
38
  gem("sidekiq", require: false)
40
39
  gem("nokogiri", require: false)
41
- gem("config", require: false)
40
+ gem("config", github: "rubyconfig/config", branch: "master", require: false)
42
41
  gem("aasm", require: false)
43
42
  gem("bcrypt", require: false)
44
43
  gem("xpath", require: false)
@@ -48,3 +47,7 @@ group(:development, :test) do
48
47
  # https://github.com/rails/rails/blob/0919aa97260ab8240150278d3b07a1547489e3fd/Gemfile#L178-L191
49
48
  gem("net-smtp", "0.3.1", require: false)
50
49
  end
50
+
51
+ group :test do
52
+ gem("webmock")
53
+ end
data/README.md CHANGED
@@ -42,15 +42,19 @@ end
42
42
 
43
43
  Run `bundle install` and make sure Tapioca is properly installed:
44
44
 
45
- ```sh
46
- $ bundle exec tapioca help
45
+ <!-- START_HELP -->
46
+ ```shell
47
+ $ tapioca help
48
+
47
49
  Commands:
48
50
  tapioca --version, -v # show version
49
- tapioca clean-shims # clean duplicated definitions in shim RBIs
51
+ tapioca annotations # Pull gem RBI annotations from remote sources
52
+ tapioca check-shims # check duplicated definitions in shim RBIs
53
+ tapioca configure # initialize folder structure and type checking configuration
50
54
  tapioca dsl [constant...] # generate RBIs for dynamic methods
51
55
  tapioca gem [gem...] # generate RBIs from gems
52
56
  tapioca help [COMMAND] # Describe available commands or one specific command
53
- tapioca init # initializes folder structure
57
+ tapioca init # get project ready for type checking
54
58
  tapioca require # generate the list of files to be required by tapioca
55
59
  tapioca todo # generate the list of unresolved constants
56
60
 
@@ -58,24 +62,27 @@ Options:
58
62
  -c, [--config=<config file path>] # Path to the Tapioca configuration file
59
63
  # Default: sorbet/tapioca/config.yml
60
64
  -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
65
+
61
66
  ```
67
+ <!-- END_HELP -->
62
68
 
63
69
  ## Getting started
64
70
 
65
71
  Execute this command to get started:
66
72
 
67
- ```sh
73
+ ```shell
68
74
  $ bundle exec tapioca init
69
- create sorbet/config
70
- create sorbet/tapioca/config.yml
71
- create sorbet/tapioca/require.rb
72
- create bin/tapioca
73
75
  ```
74
76
 
75
77
  This will:
76
78
 
77
- * create the [configuration file for Sorbet](https://sorbet.org/docs/cli#config-file), the [configuration file for Tapioca](#Configuration) and the [require.rb file](#manually-requiring-parts-of-a-gem)
78
- * install the [binstub](https://bundler.io/man/bundle-binstubs.1.html#DESCRIPTION) for Tapioca in your app's `bin/` folder, so that you can use `bin/tapioca` to run commands in your app
79
+ 1. create the [configuration file for Sorbet](https://sorbet.org/docs/cli#config-file), the [configuration file for Tapioca](#Configuration) and the [require.rb file](#manually-requiring-parts-of-a-gem)
80
+ 2. install the [binstub](https://bundler.io/man/bundle-binstubs.1.html#DESCRIPTION) for Tapioca in your app's `bin/` folder, so that you can use `bin/tapioca` to run commands in your app
81
+ 3. pull the community RBI annotations from the [central repository](https://github.com/Shopify/rbi-central) matching your app's gems
82
+ 4. generate the RBIs for your app's gems
83
+ 5. generate the RBI file for missing constants
84
+
85
+ See the following sections for more details about each step.
79
86
 
80
87
  <!-- START_HELP_COMMAND_INIT -->
81
88
  ```shell
@@ -89,7 +96,7 @@ Options:
89
96
  # Default: sorbet/tapioca/config.yml
90
97
  -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
91
98
 
92
- initializes folder structure
99
+ get project ready for type checking
93
100
  ```
94
101
  <!-- END_HELP_COMMAND_INIT -->
95
102
 
@@ -101,7 +108,7 @@ Sorbet does not read the code in your gem dependencies, so it does not know the
101
108
 
102
109
  In order to generate the RBI files for the gems used in your application, run the following command:
103
110
 
104
- ```sh
111
+ ```shell
105
112
  $ bin/tapioca gems [gems...]
106
113
 
107
114
  Removing RBI files of gems that have been removed:
@@ -155,6 +162,8 @@ Options:
155
162
  # Default: sorbet/rbi/dsl
156
163
  [--rbi-max-line-length=N] # Set the max line length of generated RBIs. Signatures longer than the max line length will be wrapped
157
164
  # Default: 120
165
+ -e, [--environment=ENVIRONMENT] # The Rack/Rails environment to use when generating RBIs
166
+ # Default: development
158
167
  -c, [--config=<config file path>] # Path to the Tapioca configuration file
159
168
  # Default: sorbet/tapioca/config.yml
160
169
  -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
@@ -163,11 +172,17 @@ generate RBIs from gems
163
172
  ```
164
173
  <!-- END_HELP_COMMAND_GEM -->
165
174
 
175
+ By default, running `tapioca gem` will only generate the RBI files for gems that have been added to or removed from the project's `Gemfile` this means that Tapioca will not regenerate the RBI files for untouched gems. However, when changing Tapioca configuration or bumping its version, it may be useful to force the regeneration of the RBI files previsouly generated. This can be done with the `--all` option:
176
+
177
+ ```shell
178
+ bin/tapioca gems --all
179
+ ```
180
+
166
181
  > Are you coming from `srb rbi`? [See how `tapioca gem` compares to `srb rbi`](https://github.com/Shopify/tapioca/wiki/How-does-tapioca-compare-to-%22srb-rbi-gems%22-%3F).
167
182
 
168
183
  #### Manually requiring parts of a gem
169
184
 
170
- It may happen that the RBI file generated for a gem listed inside your `Gemfile.lock` is missing some definitions taht you would expect it to be exporting.
185
+ It may happen that the RBI file generated for a gem listed inside your `Gemfile.lock` is missing some definitions that you would expect it to be exporting.
171
186
 
172
187
  For gems that have a normal default `require` and that load all of their constants through that, everything should work seamlessly. However, for gems that are marked as `require: false` in the `Gemfile`, or for gems that export constants optionally via different requires, where a single require does not load the whole gem code into memory, Tapioca will not be able to load some of the types into memory and, thus, won't be able to generate complete RBIs for them. For this reason, we need to keep a small external file named `sorbet/tapioca/require.rb` that is executed after all the gems in the `Gemfile` have been required and before generation of gem RBIs have started. This file is responsible for adding the requires for additional files from gems, which are not covered by the default require.
173
188
 
@@ -210,7 +225,7 @@ If you ever run into a case, where you add a gem or update the version of a gem
210
225
 
211
226
  To help you get started, you can use the command `tapioca require` to auto-populate the contents of the `sorbet/tapioca/require.rb` file with all the requires found in your application:
212
227
 
213
- ```sh
228
+ ```shell
214
229
  $ bin/tapioca require
215
230
 
216
231
  Compiling sorbet/tapioca/require.rb, this may take a few seconds... Done
@@ -223,11 +238,11 @@ Once the file is generated, you should review it, remove all unnecessary require
223
238
 
224
239
  #### Excluding a gem from RBI generation
225
240
 
226
- It may be useful to exclude some gems from the generation process. For example for gems that are in Bundle's debug group or gems of which the contents are dependent on the architecture they are loaded on. A typical example is `fakefs`, which, if loaded into memory, changes `File` operations to be no-ops and breaks Tapioca RBI file generation altogether.
241
+ It may be useful to exclude some gems from the generation process. For example for gems that are in Bundle's debug group or gems of which the contents are dependent on the architecture they are loaded on.
227
242
 
228
243
  To do so you can pass the list of gems you want to exclude in the command line with the `--exclude` option:
229
244
 
230
- ```sh
245
+ ```shell
231
246
  $ bin/tapioca gems --exclude gemA gemB
232
247
  ```
233
248
 
@@ -240,13 +255,18 @@ gem:
240
255
  - gemB
241
256
  ```
242
257
 
258
+ There are a few development/test environment gems that can cause RBI generation issues, so Tapioca skips them by default:
259
+
260
+ * `debug`
261
+ * `fakefs`
262
+
243
263
  #### Changing the strictness level of the RBI for a gem
244
264
 
245
265
  By default, all RBI files for gems are generated with the [strictness level](https://sorbet.org/docs/static#file-level-granularity-strictness-levels) `typed: true`. Sometimes, this strictness level can create type-checking errors when a gem contains definitions that conflict with [Sorbet internal definitions for Ruby core and standard library](https://sorbet.org/docs/faq#it-looks-like-sorbets-types-for-the-stdlib-are-wrong).
246
266
 
247
267
  Tapioca comes with an automatic detection (option `--auto-strictness`, enabled by default) of such cases and will switch the strictness level to `typed: false` in RBI files containing conflicts with the core and standard library definitions. It is nonetheless possible to manually switch the strictness level for a gem using the `--typed-overrides` option:
248
268
 
249
- ```sh
269
+ ```shell
250
270
  $ bin/tapioca gems --typed-overrides gemA:false gemB:false
251
271
  ```
252
272
 
@@ -263,7 +283,7 @@ gem:
263
283
 
264
284
  To ensure all RBI files for gems are up-to-date with the latest changes in your `Gemfile.lock`, Tapioca provides a `--verify` option:
265
285
 
266
- ```sh
286
+ ```shell
267
287
  $ bin/tapioca gems --verify
268
288
 
269
289
  Checking for out-of-date RBIs...
@@ -273,6 +293,115 @@ Nothing to do, all RBIs are up-to-date.
273
293
 
274
294
  This option can be used on CI to make sure the RBI files are always up-to-date and ensure accurate type checking. **Warning**: doing so will break your normal Dependabot workflow as every pull-request opened to bump a gem version will fail CI since the RBI will be out-of-date and will require you to manually run `bin/tapioca gems` to update them.
275
295
 
296
+ ### Pulling RBI annotations from remote sources
297
+
298
+ Since Tapioca does not perform any type inference, the RBI files generated for the gems do not contain any type signatures. Instead, Tapioca relies on the community to provide high-quality, manually written RBI annotations for public gems.
299
+
300
+ To pull the annotations relevant to your project from the central repository, run the `annotations` command:
301
+
302
+ ```shell
303
+ $ bin/tapioca annotations
304
+
305
+ Retrieving index from central repository... Done
306
+ Listing gems from Gemfile.lock... Done
307
+ Removing annotations for gems that have been removed... Nothing to do
308
+ Fetching gem annotations from central repository...
309
+
310
+ Fetched activesupport
311
+ created sorbet/rbi/annotations/activesupport.rbi
312
+
313
+ Done
314
+ ```
315
+
316
+ <!-- START_HELP_COMMAND_ANNOTATIONS -->
317
+ ```shell
318
+ $ tapioca help annotations
319
+
320
+ Usage:
321
+ tapioca annotations
322
+
323
+ Options:
324
+ [--sources=one two three] # URIs of the sources to pull gem RBI annotations from
325
+ # Default: ["https://raw.githubusercontent.com/Shopify/rbi-central/main"]
326
+ [--netrc], [--no-netrc] # Use .netrc to authenticate to private sources
327
+ # Default: true
328
+ [--netrc-file=NETRC_FILE] # Path to .netrc file
329
+ [--auth=AUTH] # HTTP authorization header for private sources
330
+ --typed, -t, [--typed-overrides=gem:level [gem:level ...]] # Override for typed sigils for pulled annotations
331
+ -c, [--config=<config file path>] # Path to the Tapioca configuration file
332
+ # Default: sorbet/tapioca/config.yml
333
+ -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
334
+
335
+ Pull gem RBI annotations from remote sources
336
+ ```
337
+ <!-- END_HELP_COMMAND_ANNOTATIONS -->
338
+
339
+ By default, Tapioca will pull the annotations stored in the central repository located at https://github.com/Shopify/rbi-central. It is possible to use a custom repository by changing the value of the `--sources` options. For example if your repository is stored on Github:
340
+
341
+ ```shell
342
+ $ bin/tapioca annotations --sources https://raw.githubusercontent.com/$USER/$REPO/$BRANCH
343
+ ```
344
+
345
+ Tapioca also supports pulling annotations from multiple sources:
346
+
347
+ ```shell
348
+ $ bin/tapioca annotations --sources https://raw.githubusercontent.com/$USER/$REPO1/$BRANCH https://raw.githubusercontent.com/$USER/$REPO2/$BRANCH
349
+ ```
350
+
351
+ #### Basic authentication
352
+
353
+ Private repositories can be used as sources by passing the option `--auth` with an authentication string. For Github, this string is `token $TOKEN` where `$TOKEN` is a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token):
354
+
355
+ ```shell
356
+ $ bin/tapioca annotations --sources https://raw.githubusercontent.com/$USER/$PRIVATE_REPO/$BRANCH --auth "token $TOKEN"
357
+ ```
358
+
359
+ #### Using a .netrc file
360
+
361
+ Tapioca supports reading credentials from a [netrc](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html) file (defaulting to `~/.netrc`).
362
+
363
+ Given these lines in your netrc:
364
+
365
+ ```netrc
366
+ machine raw.githubusercontent.com
367
+ login $USERNAME
368
+ password $TOKEN
369
+ ```
370
+
371
+ where `$USERNAME` is your Github username and `$TOKEN` is a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), then, if you run Tapioca with the `--netrc` option (enabled by default), your annotation requests should be authenticated properly.
372
+
373
+ The `--netrc-file` option can be specified to read from a file other than `~/.netrc`:
374
+
375
+ ```shell
376
+ $ bin/tapioca annotations --netrc-file /path/to/my/netrc/file
377
+ ```
378
+
379
+ Similar to `--netrc-file`, you can also specify an alternative netrc file by using the `TAPIOCA_NETRC_FILE` environment variable:
380
+
381
+ ```shell
382
+ $ TAPIOCA_NETRC_FILE=/path/to/my/netrc/file bin/tapioca annotations
383
+ ```
384
+
385
+ Tapioca will first try to find the netrc file as specified by the `--netrc-file` option. If that option is not supplied, it will try the `TAPIOCA_NETRC_FILE` environment variable value. If that value is not supplied either, it will fallback to `~/.netrc`.
386
+
387
+ #### Changing the typed strictness of annotations files
388
+
389
+ Sometimes the annotations files pulled by Tapioca will create type errors in your project because of incompatibilities.
390
+ It is possible to ignore such files by switching their strictness level `--typed-overrides` option:
391
+
392
+ ```shell
393
+ $ bin/tapioca annotations --typed-overrides gemA:ignore gemB:false
394
+ ```
395
+
396
+ Or through the configuration file:
397
+
398
+ ```yaml
399
+ annotations:
400
+ typed_overrides:
401
+ gemA: "ignore"
402
+ gemB: "false"
403
+ ```
404
+
276
405
  ### Generating RBI files for Rails and other DSLs
277
406
 
278
407
  Sorbet by itself does not understand DSLs involving meta-programming, such as Rails. This means that Sorbet won't know about constants and methods generated by `ActiveRecord` or `ActiveSupport`.
@@ -280,7 +409,7 @@ To solve this, Tapioca can load your application and introspect it to find the c
280
409
 
281
410
  To generate the RBI files for the DSLs used in your application, run the following command:
282
411
 
283
- ```sh
412
+ ```shell
284
413
  $ bin/tapioca dsl
285
414
 
286
415
  Loading Rails application... Done
@@ -315,6 +444,8 @@ Options:
315
444
  # Default: 1
316
445
  [--rbi-max-line-length=N] # Set the max line length of generated RBIs. Signatures longer than the max line length will be wrapped
317
446
  # Default: 120
447
+ -e, [--environment=ENVIRONMENT] # The Rack/Rails environment to use when generating RBIs
448
+ # Default: development
318
449
  -c, [--config=<config file path>] # Path to the Tapioca configuration file
319
450
  # Default: sorbet/tapioca/config.yml
320
451
  -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
@@ -327,7 +458,7 @@ generate RBIs for dynamic methods
327
458
 
328
459
  To ensure all RBI files for DSLs are up-to-date with the latest changes in your application or database, Tapioca provide a `--verify` option:
329
460
 
330
- ```sh
461
+ ```shell
331
462
  $ bin/tapioca dsl --verify
332
463
 
333
464
  Loading Rails application... Done
@@ -517,7 +648,7 @@ To get you started quickly, Tapioca can create a RBI file containing a stub of a
517
648
 
518
649
  To generate the RBI file for the missing constants used in your application run the following command:
519
650
 
520
- ```sh
651
+ ```shell
521
652
  $ bin/tapioca todo
522
653
 
523
654
  Compiling sorbet/rbi/todo.rbi, this may take a few seconds... Done
@@ -566,13 +697,14 @@ end
566
697
 
567
698
  As you migrate to newer versions of Sorbet or Tapioca, some shims may become useless as Sorbet's internal definitions for Ruby's core and standard library is enhanced or Tapioca is able to generate definitions for new DSLs. To avoid keeping outdated or useless definitions inside your application shims, Tapioca provides the `check-shims` command:
568
699
 
569
- ```sh
700
+ ```shell
570
701
  $ bin/tapioca check-shims
571
702
 
572
703
  Loading Sorbet payload... Done
573
704
  Loading shim RBIs from sorbet/rbi/shims... Done
574
705
  Loading gem RBIs from sorbet/rbi/gems... Done
575
706
  Loading gem RBIs from sorbet/rbi/dsl... Done
707
+ Loading annotation RBIs from sorbet/rbi/annotations... Done
576
708
  Looking for duplicates... Done
577
709
 
578
710
  Duplicated RBI for ::MyModel#title:
@@ -588,27 +720,33 @@ Please remove the duplicated definitions from the sorbet/rbi/shims directory.
588
720
 
589
721
  This command can be used on CI to make sure the RBI shims are always up-to-date and non-redundant with generated files.
590
722
 
591
- <!-- START_HELP_COMMAND_CHECK-SHIMS -->
723
+ <!-- START_HELP_COMMAND_CHECK_SHIMS -->
592
724
  ```shell
593
- $ bin/tapioca help check-shims
725
+ $ tapioca help check_shims
594
726
 
595
727
  Usage:
596
728
  tapioca check-shims
597
729
 
598
730
  Options:
599
- [--gem-rbi-dir=GEM_RBI_DIR] # Path to gem RBIs
600
- # Default: sorbet/rbi/gems
601
- [--dsl-rbi-dir=DSL_RBI_DIR] # Path to DSL RBIs
602
- # Default: sorbet/rbi/dsl
603
- [--shim-rbi-dir=SHIM_RBI_DIR] # Path to shim RBIs
604
- # Default: sorbet/rbi/shims
605
- -c, [--config=<config file path>] # Path to the Tapioca configuration file
606
- # Default: sorbet/tapioca/config.yml
607
- -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
731
+ [--gem-rbi-dir=GEM_RBI_DIR] # Path to gem RBIs
732
+ # Default: sorbet/rbi/gems
733
+ [--dsl-rbi-dir=DSL_RBI_DIR] # Path to DSL RBIs
734
+ # Default: sorbet/rbi/dsl
735
+ [--shim-rbi-dir=SHIM_RBI_DIR] # Path to shim RBIs
736
+ # Default: sorbet/rbi/shims
737
+ [--annotations-rbi-dir=ANNOTATIONS_RBI_DIR] # Path to annotations RBIs
738
+ # Default: sorbet/rbi/annotations
739
+ [--todo-rbi-file=TODO_RBI_FILE] # Path to the generated todo RBI file
740
+ # Default: sorbet/rbi/todo.rbi
741
+ [--payload], [--no-payload] # Check shims against Sorbet's payload
742
+ # Default: true
743
+ -c, [--config=<config file path>] # Path to the Tapioca configuration file
744
+ # Default: sorbet/tapioca/config.yml
745
+ -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
608
746
 
609
747
  check duplicated definitions in shim RBIs
610
748
  ```
611
- <!-- END_HELP_COMMAND_CHECK-SHIMS -->
749
+ <!-- END_HELP_COMMAND_CHECK_SHIMS -->
612
750
 
613
751
  ### Configuration
614
752
 
@@ -652,6 +790,7 @@ dsl:
652
790
  quiet: false
653
791
  workers: 1
654
792
  rbi_max_line_length: 120
793
+ environment: development
655
794
  gem:
656
795
  outdir: sorbet/rbi/gems
657
796
  file_header: true
@@ -668,13 +807,20 @@ gem:
668
807
  auto_strictness: true
669
808
  dsl_dir: sorbet/rbi/dsl
670
809
  rbi_max_line_length: 120
810
+ environment: development
671
811
  check_shims:
672
812
  gem_rbi_dir: sorbet/rbi/gems
673
813
  dsl_rbi_dir: sorbet/rbi/dsl
674
814
  shim_rbi_dir: sorbet/rbi/shims
815
+ annotations_rbi_dir: sorbet/rbi/annotations
816
+ todo_rbi_file: sorbet/rbi/todo.rbi
675
817
  payload: true
676
818
  annotations:
677
- repo_uri: https://raw.githubusercontent.com/Shopify/rbi-central/main
819
+ sources:
820
+ - https://raw.githubusercontent.com/Shopify/rbi-central/main
821
+ netrc: true
822
+ netrc_file: ''
823
+ typed_overrides: {}
678
824
  ```
679
825
  <!-- END_CONFIG_TEMPLATE -->
680
826